8000 bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a clas… · python/cpython@4a85718 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a85718

Browse files
authored
bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699)
1 parent 15d3861 commit 4a85718

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/pathlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ def cwd(cls):
978978
"""Return a new path pointing to the current working directory
979979
(as returned by os.getcwd()).
980980
"""
981-
return cls(cls()._accessor.getcwd())
981+
return cls(cls._accessor.getcwd())
982982

983983
@classmethod
984984
def home(cls):

0 commit comments

Comments
 (0)
0