From 2ea9c203f7afbcc8fe2e592840d2442832298f55 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 18 Jul 2022 06:49:27 -0400 Subject: [PATCH 1/2] docs: use 'recursively' in the description of rglob, and mention globs in the os equivalences --- Doc/library/pathlib.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index d5cda3adc8d512..f9daf585e34adf 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1122,8 +1122,8 @@ call fails (for example because the path doesn't exist). .. method:: Path.rglob(pattern) - This is like calling :func:`Path.glob` with "``**/``" added in front of the - given relative *pattern*:: + Glob the given relative *pattern* recursively. This is like calling + :func:`Path.glob` with "``**/``" added in front of the *pattern*:: >>> sorted(Path().rglob("*.py")) [PosixPath('build/lib/pathlib.py'), @@ -1302,6 +1302,7 @@ Below is a table mapping various :mod:`os` functions to their corresponding :func:`os.path.samefile` :meth:`Path.samefile` :func:`os.path.splitext` :data:`PurePath.stem` and :data:`PurePath.suffix` +:func:`os.walk` :meth:`Path.glob` and :meth:`Path.rglob` ==================================== ============================== .. rubric:: Footnotes From 0173385b6637747eee5c89d1786958c28e401552 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 20 Jul 2022 14:39:00 -0700 Subject: [PATCH 2/2] Update Doc/library/pathlib.rst --- Doc/library/pathlib.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index f9daf585e34adf..04549184be2aea 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1302,7 +1302,6 @@ Below is a table mapping various :mod:`os` functions to their corresponding :func:`os.path.samefile` :meth:`Path.samefile` :func:`os.path.splitext` :data:`PurePath.stem` and :data:`PurePath.suffix` -:func:`os.walk` :meth:`Path.glob` and :meth:`Path.rglob` ==================================== ============================== .. rubric:: Footnotes