SIGN IN SIGN UP

GH-115060: Speed up `pathlib.Path.glob()` by removing redundant regex matching (#115061)

When expanding and filtering paths for a `**` wildcard segment, build an `re.Pattern` object from the subsequent pattern parts, rather than the entire pattern, and match against the `os.DirEntry` object prior to instantiating a path object. Also skip compiling a pattern when expanding a `*` wildcard segment.
B
Barney Gale committed
6f93b4df92b8fbf80529cb6435789f5a75664a20
Parent: 9d1a353
Committed by GitHub <noreply@github.com> on 2/10/2024, 6:12:34 PM