]> granicus.if.org Git - python/commitdiff
Cross-reference os.DirEntry and pathlib.Path for issue #22570.
authorGuido van Rossum <guido@python.org>
Wed, 6 Jan 2016 19:36:03 +0000 (11:36 -0800)
committerGuido van Rossum <guido@python.org>
Wed, 6 Jan 2016 19:36:03 +0000 (11:36 -0800)
Doc/library/os.rst
Doc/library/pathlib.rst

index 144d9b24c8ee6ef7eec99890de0ebceb64d63d31..dcdc4ec0eaaea3be15e82b348c9c336f96363f45 100644 (file)
@@ -2035,6 +2035,12 @@ features:
       The result is cached on the ``DirEntry`` object. Call :func:`os.stat`
       to fetch up-to-date information.
 
+   Note that there is a nice correspondence between several attributes
+   and methods of ``DirEntry`` and of :class:`pathlib.Path`.  In
+   particular, the ``name`` and ``path`` attributes have the same
+   meaning, as do the ``is_dir()``, ``is_file()``, ``is_symlink()``
+   and ``stat()`` methods.
+
    .. versionadded:: 3.5
 
 
index 9c8ca58b33f78b2e217a55cd7ae6de92d712a37a..a7ce18df3362bae8c363a7f124803eba6ffb0af8 100644 (file)
@@ -381,7 +381,11 @@ Pure paths provide the following methods and properties:
    ``arg = str(arg)``, this will still raise an exception if an object
    of some other type is given by accident.
 
+   A nice advantage is that this protocol is also supported by
+   :class:`os.DirEntry` objects returned by :func:`os.scandir`.
+
    .. versionadded:: 3.4.5
+   .. versionadded:: 3.5.2
 
 .. data:: PurePath.suffix