Skip to content

Commit

Permalink
pythonGH-101112: Specify type of pattern for Path.rglob
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 committed Jan 18, 2023
1 parent b84be8d commit 69aae06
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 69aae06

Please sign in to comment.