]> granicus.if.org Git - python/commitdiff
Document Path.is_mount(), update Misc/ACKS and Misc/NEWS (#2980)
authorŁukasz Langa <lukasz@langa.pl>
Tue, 1 Aug 2017 23:47:50 +0000 (16:47 -0700)
committerGitHub <noreply@github.com>
Tue, 1 Aug 2017 23:47:50 +0000 (16:47 -0700)
Doc/library/pathlib.rst
Misc/ACKS
Misc/NEWS.d/next/Library/2017-08-01-15-56-50.bpo-30897.OuT1-Y.rst [new file with mode: 0644]

index 0c9bd0d940ae50e705be2cbd052da2f6ef560c31..3d28a1bea30315eed9df8fd13ff0afb17199c521 100644 (file)
@@ -761,6 +761,18 @@ call fails (for example because the path doesn't exist):
    other errors (such as permission errors) are propagated.
 
 
+.. method:: Path.is_mount()
+
+   Return ``True`` if the path is a :dfn:`mount point`: a point in a
+   file system where a different file system has been mounted.  On POSIX, the
+   function checks whether *path*'s parent, :file:`path/..`, is on a different
+   device than *path*, or whether :file:`path/..` and *path* point to the same
+   i-node on the same device --- this should detect mount points for all Unix
+   and POSIX variants.  Not implemented on Windows.
+
+   .. versionadded:: 3.7
+
+
 .. method:: Path.is_symlink()
 
    Return ``True`` if the path points to a symbolic link, ``False`` otherwise.
index e0640c114ff34f6d2e16ff0ca446e3e7860110e6..f1f6c147f4976dda647e4c925bc581fd66eea90c 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -886,6 +886,7 @@ Inyeol Lee
 James Lee
 John J. Lee
 Thomas Lee
+Cooper Ry Lees
 Tennessee Leeuwenburg
 Luc Lefebvre
 Pierre Paul Lefebvre
diff --git a/Misc/NEWS.d/next/Library/2017-08-01-15-56-50.bpo-30897.OuT1-Y.rst b/Misc/NEWS.d/next/Library/2017-08-01-15-56-50.bpo-30897.OuT1-Y.rst
new file mode 100644 (file)
index 0000000..41a75b8
--- /dev/null
@@ -0,0 +1,3 @@
+``pathlib.Path`` objects now include an ``is_mount()`` method (only
+implemented on POSIX).  This is similar to ``os.path.ismount(p)``. Patch by
+Cooper Ry Lees.