diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-04-10 19:43:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-10 19:43:07 (GMT) |
commit | 6258844c27e3b5a43816e7c559089a5fe0a47123 (patch) | |
tree | a5a9a80f60f3bd15f546322cc717f280fb95bf21 /Lib/test/test_asyncio/test_streams.py | |
parent | 689ada79150f28b0053fa6c1fb646b75ab2cc200 (diff) | |
download | cpython-6258844c27e3b5a43816e7c559089a5fe0a47123.zip cpython-6258844c27e3b5a43816e7c559089a5fe0a47123.tar.gz cpython-6258844c27e3b5a43816e7c559089a5fe0a47123.tar.bz2 |
GH-117586: Speed up `pathlib.Path.glob()` by working with strings (#117589)
Move pathlib globbing implementation into a new private class: `glob._Globber`. This class implements fast string-based globbing. It's called by `pathlib.Path.glob()`, which then converts strings back to path objects.
In the private pathlib ABCs, add a `pathlib._abc.Globber` subclass that works with `PathBase` objects rather than strings, and calls user-defined path methods like `PathBase.stat()` rather than `os.stat()`.
This sets the stage for two more improvements:
- GH-115060: Query non-wildcard segments with `lstat()`
- GH-116380: Unify `pathlib` and `glob` implementations of globbing.
No change to the implementations of `glob.glob()` and `glob.iglob()`.
Diffstat (limited to 'Lib/test/test_asyncio/test_streams.py')
0 files changed, 0 insertions, 0 deletions