Two optimizations are possible:
is_absolute() can pass the unnormalized path to os.path.isabs()
absolute() on an empty path (or Path.cwd()) can avoid joining an empty string onto the working directory (thus avoiding a call to os.path.join()), and short-circuit the string normalization (as the result of getcwd() is fully normalized)
Linked PRs
Two optimizations are possible:
is_absolute()can pass the unnormalized path toos.path.isabs()absolute()on an empty path (orPath.cwd()) can avoid joining an empty string onto the working directory (thus avoiding a call toos.path.join()), and short-circuit the string normalization (as the result ofgetcwd()is fully normalized)Linked PRs
pathlib.Path.[is_]absolute()#103549