GH-115060: Speed up `pathlib.Path.glob()` by removing redundant regex matching by barneygale · Pull Request #115061 · python/cpython · GitHub

github.com

Tin mới

barneygale:gh-115060

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

Speed up pathlib.Path.glob() by removing redundant regex matching #115060

pathlib.Path.glob()

awaiting core review

awaiting core review

Match against os.DirEntry.path in _select_recursive()

Matching against dot-prefixed path is fine (and faster!)

Revert "Matching against dot-prefixed path is fine (and faster!)"

Skip computing prefix len when not matching

Rename prefix_len --> parent_len for clarity.

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

segment --> component

Test post-** matching when globbing ..

Couple more test cases

pathlib.Path.glob()

⌂git
1/1