Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions Doc/library/glob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ For example, ``'[?]'`` matches the character ``'?'``.

.. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False)

Return an :term:`iterator` which yields the same values as :func:`glob`
without actually storing them all simultaneously.
Return an :term:`iterator` which yields the same values as :func:`glob.glob` without
actually storing them all simultaneously. Internally, :func:`iglob` uses
:func:`os.listdir` which may result in large amount of memory being consumed if a
single directory contains a large number of files. Unlike :func:`glob.glob`, the case
with large number of subdirectories but with small number of files per each
subdirectory, should not result in large amount of memory consumption.

.. audit-event:: glob.glob pathname,recursive glob.iglob
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:func:`glob.iglob` documentation updated with details on memory use.