Skip to content

Commit

Permalink
GH-101112: Specify type of pattern for Path.rglob (#101132)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jugmac00 authored Jan 20, 2023
1 parent f1d0711 commit 61f338a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 61f338a

Please sign in to comment.