Skip to content

Commit 18eeec4

Browse files
[3.13] gh-142972: Document arbitrary ordering in Path.glob and Path.rglob (GH-143025) (GH-143710)
gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025) (cherry picked from commit 9d13ca9) Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent cf5b31c commit 18eeec4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,10 @@ Reading directories
12871287
PosixPath('setup.py'),
12881288
PosixPath('test_pathlib.py')]
12891289

1290+
.. note::
1291+
The paths are returned in no particular order.
1292+
If you need a specific order, sort the results.
1293+
12901294
.. seealso::
12911295
:ref:`pathlib-pattern-language` documentation.
12921296

@@ -1321,6 +1325,10 @@ Reading directories
13211325
Glob the given relative *pattern* recursively. This is like calling
13221326
:func:`Path.glob` with "``**/``" added in front of the *pattern*.
13231327

1328+
.. note::
1329+
The paths are returned in no particular order.
1330+
If you need a specific order, sort the results.
1331+
13241332
.. seealso::
13251333
:ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation.
13261334

0 commit comments

Comments
 (0)