Skip to content

Commit 47320a6

Browse files
authored
Document Path.is_mount(), update Misc/ACKS and Misc/NEWS (#2980)
1 parent 9d8e6ec commit 47320a6

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,18 @@ call fails (for example because the path doesn't exist):
761761
other errors (such as permission errors) are propagated.
762762

763763

764+
.. method:: Path.is_mount()
765+
766+
Return ``True`` if the path is a :dfn:`mount point`: a point in a
767+
file system where a different file system has been mounted. On POSIX, the
768+
function checks whether *path*'s parent, :file:`path/..`, is on a different
769+
device than *path*, or whether :file:`path/..` and *path* point to the same
770+
i-node on the same device --- this should detect mount points for all Unix
771+
and POSIX variants. Not implemented on Windows.
772+
773+
.. versionadded:: 3.7
774+
775+
764776
.. method:: Path.is_symlink()
765777

766778
Return ``True`` if the path points to a symbolic link, ``False`` otherwise.

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ Inyeol Lee
886886
James Lee
887887
John J. Lee
888888
Thomas Lee
889+
Cooper Ry Lees
889890
Tennessee Leeuwenburg
890891
Luc Lefebvre
891892
Pierre Paul Lefebvre
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``pathlib.Path`` objects now include an ``is_mount()`` method (only
2+
implemented on POSIX). This is similar to ``os.path.ismount(p)``. Patch by
3+
Cooper Ry Lees.

0 commit comments

Comments
 (0)