mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #19777: Provide a home() classmethod on Path objects.
Contributed by Victor Salgado and Mayank Tripathi.
This commit is contained in:
parent
2b4ec1ce8a
commit
17cba7daf5
5 changed files with 34 additions and 0 deletions
|
|
@ -628,6 +628,17 @@ call fails (for example because the path doesn't exist):
|
|||
PosixPath('/home/antoine/pathlib')
|
||||
|
||||
|
||||
.. classmethod:: Path.home()
|
||||
|
||||
Return a new path object representing the user's home directory (as
|
||||
returned by :func:`os.path.expanduser` with ``~`` construct)::
|
||||
|
||||
>>> Path.home()
|
||||
PosixPath('/home/antoine')
|
||||
|
||||
.. versionadded:: 3.5
|
||||
|
||||
|
||||
.. method:: Path.stat()
|
||||
|
||||
Return information about this path (similarly to :func:`os.stat`).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue