Browse Source
bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699)
pull/25702/head
kfollstad
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
Lib/pathlib.py
|
|
|
@ -978,7 +978,7 @@ class Path(PurePath): |
|
|
|
"""Return a new path pointing to the current working directory |
|
|
|
(as returned by os.getcwd()). |
|
|
|
""" |
|
|
|
return cls(cls()._accessor.getcwd()) |
|
|
|
return cls(cls._accessor.getcwd()) |
|
|
|
|
|
|
|
@classmethod |
|
|
|
def home(cls): |
|
|
|
|