-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
Description
The implementation of pathlib.Path.absolute()
can call with_segments()
with multiple arguments; the resulting path object will be internally unjoined and unparsed, making str(path.absolute())
slow, amongst other things.
absolute()
already has most of the information it needs to produce paths that are pre-joined, and either pre-parsed (if the input has tail segments) or pre-stringified (otherwise). This could provide a tasty speedup.
Linked PRs
AlexWaygood