summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pathlib.rst29
-rw-r--r--Doc/whatsnew/3.14.rst6
2 files changed, 0 insertions, 35 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index a42ac1f..4b48880 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -1289,35 +1289,6 @@ Reading directories
raised.
-.. method:: Path.scandir()
-
- When the path points to a directory, return an iterator of
- :class:`os.DirEntry` objects corresponding to entries in the directory. The
- returned iterator supports the :term:`context manager` protocol. It is
- implemented using :func:`os.scandir` and gives the same guarantees.
-
- Using :meth:`~Path.scandir` instead of :meth:`~Path.iterdir` can
- significantly increase the performance of code that also needs file type or
- file attribute information, because :class:`os.DirEntry` objects expose
- this information if the operating system provides it when scanning a
- directory.
-
- The following example displays the names of subdirectories. The
- ``entry.is_dir()`` check will generally not make an additional system call::
-
- >>> p = Path('docs')
- >>> with p.scandir() as entries:
- ... for entry in entries:
- ... if entry.is_dir():
- ... entry.name
- ...
- '_templates'
- '_build'
- '_static'
-
- .. versionadded:: 3.14
-
-
.. method:: Path.glob(pattern, *, case_sensitive=None, recurse_symlinks=False)
Glob the given relative *pattern* in the directory represented by this path,
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index db25c03..b300e34 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -532,12 +532,6 @@ pathlib
(Contributed by Barney Gale in :gh:`73991`.)
-* Add :meth:`pathlib.Path.scandir` to scan a directory and return an iterator
- of :class:`os.DirEntry` objects. This is exactly equivalent to calling
- :func:`os.scandir` on a path object.
-
- (Contributed by Barney Gale in :gh:`125413`.)
-
pdb
---