]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025)
authorBartosz Sławecki <bartosz@ilikepython.com>
Sun, 11 Jan 2026 19:36:47 +0000 (20:36 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Jan 2026 19:36:47 +0000 (14:36 -0500)
Doc/library/pathlib.rst

index 79e0b7f09eaa77734abe1faef368f7b722d372b4..1575de6c6f5935d1be7bd4ed33e001953048e3eb 100644 (file)
@@ -1331,6 +1331,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.
 
@@ -1365,6 +1369,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.