]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-101112: Specify type of pattern for Path.rglob (#101132)
authorJürgen Gmach <juergen.gmach@googlemail.com>
Fri, 20 Jan 2023 22:11:31 +0000 (23:11 +0100)
committerGitHub <noreply@github.com>
Fri, 20 Jan 2023 22:11:31 +0000 (23:11 +0100)
The documentation for `rglob` did not mention what `pattern` actually
is.

Mentioning and linking to `fnmatch` makes this explicit, as the
documentation for `fnmatch` both shows the syntax and some explanation.

Doc/library/pathlib.rst

index c5cf409f5f1f812cce438dc8a93e162e96699dde..42d63b1a8f096b366b152cffc3ca0de185963502 100644 (file)
@@ -1270,7 +1270,8 @@ call fails (for example because the path doesn't exist).
 .. method:: Path.rglob(pattern)
 
    Glob the given relative *pattern* recursively.  This is like calling
-   :func:`Path.glob` with "``**/``" added in front of the *pattern*::
+   :func:`Path.glob` with "``**/``" added in front of the *pattern*, where
+   *patterns* are the same as for :mod:`fnmatch`::
 
       >>> sorted(Path().rglob("*.py"))
       [PosixPath('build/lib/pathlib.py'),