Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
The implementation ofpathlib.Path.absolute() can callwith_segments() with multiple arguments; the resulting path object will be internally unjoined and unparsed, makingstr(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.