Issue #19777: Provide a home() classmethod on Path objects.

Contributed by Victor Salgado and Mayank Tripathi.
This commit is contained in:
Antoine Pitrou 2015-01-12 21:03:41 +01:00
parent 2b4ec1ce8a
commit 17cba7daf5
5 changed files with 34 additions and 0 deletions

View file

@ -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`).