Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-117586: Speed up pathlib.Path.glob() by working with strings #117589

Merged
merged 8 commits into from
Apr 10, 2024

Commits on Apr 6, 2024

  1. pythonGH-117586: Speed up pathlib.Path.glob() by working with strings

    Move pathlib globbing implementation to a new module and class:
    `pathlib._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:
    
    - pythonGH-115060: Query non-wildcard segments with `lstat()`
    - pythonGH-116380: Move `pathlib._glob` to `glob` (unify implementations).
    barneygale committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    fe2c46c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26d2c03 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d6314ac View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8696ca0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    824f1f6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    60eb3d0 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2024

  1. Configuration menu
    Copy the full SHA
    98dea96 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ebcd7fc View commit details
    Browse the repository at this point in the history