Improve performance of pathlib.Path.absolute() #100562
Labels
3.12
only security fixes
performance
Performance or resource usage
topic-pathlib
type-feature
A feature request or enhancement
The current implementation of
pathlib.Path.absolute()
callsself.cwd()
rather thanos.getcwd()
, and so constructs twoPath
objects rather than one. As path objects are slow to construct, this has a performance impact.Linked PRs
pathlib.Path.absolute()
#100563The text was updated successfully, but these errors were encountered: