summaryrefslogtreecommitdiffstats
path: root/Doc/library/pathlib.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2015-01-12 20:03:41 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2015-01-12 20:03:41 (GMT)
commit17cba7daf5cdbe2a0e589be9ef507408b8dc07f1 (patch)
tree05b7922431dd4d704e4be6b4555bfd4e06dcfd62 /Doc/library/pathlib.rst
parent2b4ec1ce8a1e14a0c8de4fbab9442c6260a5f27d (diff)
downloadcpython-17cba7daf5cdbe2a0e589be9ef507408b8dc07f1.zip
cpython-17cba7daf5cdbe2a0e589be9ef507408b8dc07f1.tar.gz
cpython-17cba7daf5cdbe2a0e589be9ef507408b8dc07f1.tar.bz2
Issue #19777: Provide a home() classmethod on Path objects.
Contributed by Victor Salgado and Mayank Tripathi.
Diffstat (limited to 'Doc/library/pathlib.rst')
-rw-r--r--Doc/library/pathlib.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index c796cf4..0226ce4 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -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`).