mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
GH-101112: Specify type of pattern for Path.rglob (#101132)
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.
This commit is contained in:
parent
f1d0711dd3
commit
61f338a005
1 changed files with 2 additions and 1 deletions
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue