From 18eeec4beae1b16b5000efe1281e3f8fa55ecc95 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:42:44 +0100 Subject: [PATCH] [3.13] gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025) (GH-143710) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025) (cherry picked from commit 9d13ca97c1a83ed649a16fb0512b5f1c5f9ad108) Co-authored-by: Bartosz Sławecki --- Doc/library/pathlib.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 59a72a955597..cfb9971cec8c 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -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. -- 2.47.3