◐ Shell
clean mode source ↗

GH-125413: pathlib ABCs: use `scandir()` to speed up `walk()` by barneygale · Pull Request #126262 · python/cpython

Use the new `PathBase.scandir()` method in `PathBase.walk()`, which greatly
reduces the number of `PathBase.stat()` calls needed when walking.

There are no user-facing changes, because the pathlib ABCs are still
private and `Path.walk()` doesn't use the implementation in its superclass.

@barneygale

picnixz pushed a commit to picnixz/cpython that referenced this pull request

Dec 8, 2024
…ython#126262)

Use the new `PathBase.scandir()` method in `PathBase.walk()`, which greatly
reduces the number of `PathBase.stat()` calls needed when walking.

There are no user-facing changes, because the pathlib ABCs are still
private and `Path.walk()` doesn't use the implementation in its superclass.

ebonnal pushed a commit to ebonnal/cpython that referenced this pull request

Jan 12, 2025
…ython#126262)

Use the new `PathBase.scandir()` method in `PathBase.walk()`, which greatly
reduces the number of `PathBase.stat()` calls needed when walking.

There are no user-facing changes, because the pathlib ABCs are still
private and `Path.walk()` doesn't use the implementation in its superclass.