Skip to content

Commit bfc57f7

Browse files
[3.14] gh-142972: Document arbitrary ordering in Path.glob and Path.rglob (GH-143025) (GH-143709)
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 1b38e89 commit bfc57f7

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
@@ -1345,6 +1345,10 @@ Reading directories
13451345
PosixPath('setup.py'),
13461346
PosixPath('test_pathlib.py')]
13471347

1348+
.. note::
1349+
The paths are returned in no particular order.
1350+
If you need a specific order, sort the results.
1351+
13481352
.. seealso::
13491353
:ref:`pathlib-pattern-language` documentation.
13501354

@@ -1379,6 +1383,10 @@ Reading directories
13791383
Glob the given relative *pattern* recursively. This is like calling
13801384
:func:`Path.glob` with "``**/``" added in front of the *pattern*.
13811385

1386+
.. note::
1387+
The paths are returned in no particular order.
1388+
If you need a specific order, sort the results.
1389+
13821390
.. seealso::
13831391
:ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation.
13841392

0 commit comments

Comments
 (0)