Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.12] GH-105113: Improve performance ofpathlib.PurePath.match()#105114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedMay 30, 2023
edited
Loading

We now compile anre.Pattern object for the entire pattern. This is made more difficult byfnmatch not treating directory separators as special when evaluating wildcards (*,?, etc), and so we arrange the path parts onto separatelines in a string, and ensure we don't setre.DOTALL.

Partial backport of#101398 (excludes support for** wildcards).


📚 Documentation preview 📚:https://cpython-previews--105114.org.readthedocs.build/

We now compile a `re.Pattern` object for the entire pattern. This is mademore difficult by `fnmatch` not treating directory separators as specialwhen evaluating wildcards (`*`, `?`, etc), and so we arrange the path partsonto separate *lines* in a string, and ensure we don't set `re.DOTALL`.Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zoobazoobazooba approved these changes

Assignees
No one assigned
Labels
performancePerformance or resource usagetopic-pathlib
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@barneygale@zooba@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp