[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 9d13ca97c1)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
This commit is contained in:
Miss Islington (bot) 2026-01-11 20:42:44 +01:00 committed by GitHub
parent cf5b31c31a
commit 18eeec4bea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1287,6 +1287,10 @@ Reading directories
PosixPath('setup.py'),
PosixPath('test_pathlib.py')]
.. note::
The paths are returned in no particular order.
If you need a specific order, sort the results.
.. seealso::
:ref:`pathlib-pattern-language` documentation.
@ -1321,6 +1325,10 @@ Reading directories
Glob the given relative *pattern* recursively. This is like calling
:func:`Path.glob` with "``**/``" added in front of the *pattern*.
.. note::
The paths are returned in no particular order.
If you need a specific order, sort the results.
.. seealso::
:ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation.