cpython/Lib/pathlib
Barney Gale 1e610fb05f
GH-113225: Speed up pathlib.Path.walk(top_down=False) (#113693)
Use `_make_child_entry()` rather than `_make_child_relpath()` to retrieve
path objects for directories to visit. This saves the allocation of one
path object per directory in user subclasses of `PathBase`, and avoids a
second loop.

This trick does not apply when walking top-down, because users can affect
the walk by modifying *dirnames* in-place.

A side effect of this change is that, in bottom-up mode, subdirectories of
each directory are visited in reverse order, and that this order doesn't
match that of the names in *dirnames*. I suspect this is fine as the
order is arbitrary anyway.
2024-01-20 03:06:00 +00:00
..
__init__.py GH-79634: Accept path-like objects as pathlib glob patterns. (#114017) 2024-01-20 02:10:25 +00:00
_abc.py GH-113225: Speed up pathlib.Path.walk(top_down=False) (#113693) 2024-01-20 03:06:00 +00:00