GH-115060: Speed up `pathlib.Path.glob()` by not scanning literal parts (#117732)
Don't bother calling `os.scandir()` to scan for literal pattern segments, like `foo` in `foo/*.py`. Instead, append the segment(s) as-is and call through to the next selector with `exists=False`, which signals that the path might not exist. Subsequent selectors will call `os.scandir()` or `os.lstat()` to filter out missing paths as needed.
B
Barney Gale committed
0eb52f5f266d9e0a662f28a4d2dfef8c746cf96e
Parent: 069de14
Committed by GitHub <noreply@github.com>
on 4/12/2024, 9:19:21 PM