]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-113528: Deoptimise `pathlib._abc.PurePathBase.parts` (#113883)
authorBarney Gale <barney.gale@gmail.com>
Tue, 9 Jan 2024 22:46:50 +0000 (22:46 +0000)
committerGitHub <noreply@github.com>
Tue, 9 Jan 2024 22:46:50 +0000 (22:46 +0000)
commit5c7bd0e39839b27bc524e1790fe4936d987f384a
tree45c3dfcb0deac02d44a3c935ac5c7a3ca08101fd
parent623b338adf2645b09c546e7a17f2648d3a900620
GH-113528: Deoptimise `pathlib._abc.PurePathBase.parts` (#113883)

Implement `parts` using `_stack`, which itself calls `pathmod.split()`
repeatedly. This avoids use of `_tail`, which will be moved to `PurePath`
shortly.
Lib/pathlib/__init__.py
Lib/pathlib/_abc.py