]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-119169: Slightly speed up `os.walk(topdown=True)` (GH-121431)
authorBarney Gale <barney.gale@gmail.com>
Wed, 3 Sep 2025 11:57:01 +0000 (12:57 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Sep 2025 11:57:01 +0000 (13:57 +0200)
commitb19ad110278344d01a6f8d008c4cda3e07dc50e9
treeb76c5c9a30da32b158d1915c8a448f0ca3085155
parent984d928a22614488f4110311900b5b473e2ba96e
GH-119169: Slightly speed up `os.walk(topdown=True)` (GH-121431)

GH-119186: Slightly speed up `os.walk(topdown=True)`

When `os.walk()` traverses into subdirectories in top-down mode, call
`os.path.join()` once to add a trailing slash, and use string concatenation
thereafter to generate child paths.
Lib/os.py
Misc/NEWS.d/next/Library/2024-07-06-14-32-30.gh-issue-119186.E5B1HQ.rst [new file with mode: 0644]