Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,12 @@ Reading directories
If the path is not a directory or otherwise inaccessible, :exc:`OSError` is
raised.

.. warning::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning and even note directives attract too much attention. We usually avoid using them except in serious cases. Try also to shorten the text and don't describe the current behavior as a bug. For example, somethink like this:

"The contents of the directory are read in one go, but path objects are created during iteration. If you need to reduce latency for large directories, use :func:`os.scandir` instead."

Despite its name and being a generator, this function currently
does not stream directory entries: It reads all directory
entries into memory before yielding the first entry.
If you need constant-memory iteration across a large number of
directory entries, use :func:`os.scandir` instead.

.. method:: Path.glob(pattern, *, case_sensitive=None, recurse_symlinks=False)

Expand Down
Loading