mirror of
https://github.com/python/cpython.git
synced 2025-10-14 10:53:40 +00:00
bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699)
This commit is contained in:
parent
15d3861856
commit
4a85718212
1 changed files with 1 additions and 1 deletions
|
@ -978,7 +978,7 @@ class Path(PurePath):
|
||||||
"""Return a new path pointing to the current working directory
|
"""Return a new path pointing to the current working directory
|
||||||
(as returned by os.getcwd()).
|
(as returned by os.getcwd()).
|
||||||
"""
|
"""
|
||||||
return cls(cls()._accessor.getcwd())
|
return cls(cls._accessor.getcwd())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def home(cls):
|
def home(cls):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue