docs: be clearer that glob results are unordered (#140184)

* docs: be clearer that glob results are unordered

* trim down the opening paragraph
This commit is contained in:
Ned Batchelder 2025-10-19 16:16:35 -04:00 committed by GitHub
parent f9323213c9
commit ed672f7a8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 8 deletions

View file

@ -22,6 +22,9 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
dot are special cases that are not matched by '*' and '?'
patterns by default.
The order of the returned list is undefined. Sort it if you need a
particular order.
If `include_hidden` is true, the patterns '*', '?', '**' will match hidden
directories.
@ -40,6 +43,9 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
dot are special cases that are not matched by '*' and '?'
patterns.
The order of the returned paths is undefined. Sort them if you need a
particular order.
If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
"""