diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-05-13 08:50:15 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-05-13 08:50:15 (GMT) |
commit | 43e3d9409de92808b2ef5974b6a9f13eda57033f (patch) | |
tree | 1f8d1a1d379fdd3a0c76b5eae57a215df59e2854 /Doc | |
parent | 38acd4c028f72a80079c27d68c8da2efd059a38d (diff) | |
download | cpython-43e3d9409de92808b2ef5974b6a9f13eda57033f.zip cpython-43e3d9409de92808b2ef5974b6a9f13eda57033f.tar.gz cpython-43e3d9409de92808b2ef5974b6a9f13eda57033f.tar.bz2 |
Issue #19775: Add a samefile() method to pathlib Path objects.
Initial patch by Vajrasky Kok.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pathlib.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index ec1dc4f..0a2a4e3 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -884,6 +884,25 @@ call fails (for example because the path doesn't exist): Remove this directory. The directory must be empty. +.. method:: Path.samefile(other_path) + + Return whether this path points to the same file as *other_path*, which + can be either a Path object, or a string. The semantics are similar + to :func:`os.path.samefile` and :func:`os.path.samestat`. + + An :exc:`OSError` can be raised if either file cannot be accessed for some + reason. + + >>> p = Path('spam') + >>> q = Path('eggs') + >>> p.samefile(q) + False + >>> p.samefile('spam') + True + + .. versionadded:: 3.5 + + .. method:: Path.symlink_to(target, target_is_directory=False) Make this path a symbolic link to *target*. Under Windows, |