From: Bartosz Sławecki Date: Sun, 11 Jan 2026 19:36:47 +0000 (+0100) Subject: gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d13ca97c1a83ed649a16fb0512b5f1c5f9ad108;p=thirdparty%2FPython%2Fcpython.git gh-142972: Document arbitrary ordering in `Path.glob` and `Path.rglob` (GH-143025) --- diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 79e0b7f09eaa..1575de6c6f59 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -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.