From f8a484e53c7a92f7b14db631ed52301b19b74d88 Mon Sep 17 00:00:00 2001 From: kovan Date: Tue, 3 Feb 2026 23:34:38 +0100 Subject: [PATCH] gh-133360: Document zipfile.Path.glob, rglob, and match methods These methods were added in Python 3.12 but were not documented. Co-Authored-By: Claude Opus 4.5 --- Doc/library/zipfile.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index ae4e25b13b92cd..20b09a12dee8d1 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -687,6 +687,29 @@ Path objects are traversable using the ``/`` operator or ``joinpath``. Read the current file as bytes. +.. method:: Path.glob(pattern) + + Iterate over all files in the directory represented by this path that + match the given relative glob *pattern*, yielding :class:`~zipfile.Path` + objects. The *pattern* must not be empty. + + .. versionadded:: 3.12 + +.. method:: Path.rglob(pattern) + + Recursively iterate over all files matching the given relative glob + *pattern*. This is equivalent to calling :meth:`~Path.glob` with ``"**/`` + added in front of the pattern. + + .. versionadded:: 3.12 + +.. method:: Path.match(path_pattern) + + Match this path against the provided glob-style *path_pattern*. Return + ``True`` if matching is successful, ``False`` otherwise. + + .. versionadded:: 3.12 + .. method:: Path.joinpath(*other) Return a new Path object with each of the *other* arguments