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.walk() by working with strings #117726

Merged
merged 1 commit into from
Apr 11, 2024

Commits on Apr 10, 2024

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

    Move `pathlib.Path.walk()` implementation into `glob._Globber`. The new
    `glob._Globber.walk()` classmethod works with strings internally, which is
    a little faster than generating `Path` objects and keeping them normalized.
    The `pathlib.Path.walk()` method converts the strings back to path objects.
    
    In the private pathlib ABCs, our existing subclass of `_Globber` ensures
    that `PathBase` instances are used throughout.
    
    Follow-up to python#117589.
    barneygale committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    0a3d4ff View commit details
    Browse the repository at this point in the history