Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ call fails (for example because the path doesn't exist):

.. method:: Path.glob(pattern)

Glob the given *pattern* in the directory represented by this path,
Glob the given relative *pattern* in the directory represented by this path,
yielding all matching files (of any kind)::

>>> sorted(Path('.').glob('*.py'))
Expand Down Expand Up @@ -970,8 +970,8 @@ call fails (for example because the path doesn't exist):

.. method:: Path.rglob(pattern)

This is like calling :meth:`Path.glob` with "``**``" added in front of the
given *pattern*::
This is like calling :func:`Path.glob` with "``**/``" added in front of the
given relative *pattern*::

>>> sorted(Path().rglob("*.py"))
[PosixPath('build/lib/pathlib.py'),
Expand Down
5 changes: 3 additions & 2 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ def iterdir(self):

def glob(self, pattern):
"""Iterate over this subtree and yield all existing files (of any
kind, including directories) matching the given pattern.
kind, including directories) matching the given relative pattern.
"""
if not pattern:
raise ValueError("Unacceptable pattern: {!r}".format(pattern))
Expand All @@ -1104,7 +1104,8 @@ def glob(self, pattern):

def rglob(self, pattern):
"""Recursively yield all existing files (of any kind, including
directories) matching the given pattern, anywhere in this subtree.
directories) matching the given relative pattern, anywhere in
this subtree.
"""
pattern = self._flavour.casefold(pattern)
drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update documentation and docstrings for pathlib. Original patch by Mike Short.