Skip to content

gh-104269: Document glob.glob duplicates when using multiple ** patterns #105406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 11, 2024
8 changes: 8 additions & 0 deletions Doc/library/glob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ For example, ``'[?]'`` matches the character ``'?'``.
Using the "``**``" pattern in large directory trees may consume
an inordinate amount of time.

.. note::
This function might return duplicate path names if *pathname*
contains multiple "``**``" patterns and *recursive* is true.

.. versionchanged:: 3.5
Support for recursive globs using "``**``".

Expand All @@ -96,6 +100,10 @@ For example, ``'[?]'`` matches the character ``'?'``.
.. audit-event:: glob.glob pathname,recursive glob.iglob
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob

.. note::
This function might return duplicate path names if *pathname*
contains multiple "``**``" patterns and *recursive* is true.

.. versionchanged:: 3.5
Support for recursive globs using "``**``".

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Mention that :func:`glob.glob` and :func:`glob.iglob` may return duplicate
path names if multiple ``**`` patterns are present and ``recursive`` is
true.