Skip to content

Commit f8a484e

Browse files
kovanclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 7e2c9bd commit f8a484e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Doc/library/zipfile.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,29 @@ Path objects are traversable using the ``/`` operator or ``joinpath``.
687687

688688
Read the current file as bytes.
689689

690+
.. method:: Path.glob(pattern)
691+
692+
Iterate over all files in the directory represented by this path that
693+
match the given relative glob *pattern*, yielding :class:`~zipfile.Path`
694+
objects. The *pattern* must not be empty.
695+
696+
.. versionadded:: 3.12
697+
698+
.. method:: Path.rglob(pattern)
699+
700+
Recursively iterate over all files matching the given relative glob
701+
*pattern*. This is equivalent to calling :meth:`~Path.glob` with ``"**/``
702+
added in front of the pattern.
703+
704+
.. versionadded:: 3.12
705+
706+
.. method:: Path.match(path_pattern)
707+
708+
Match this path against the provided glob-style *path_pattern*. Return
709+
``True`` if matching is successful, ``False`` otherwise.
710+
711+
.. versionadded:: 3.12
712+
690713
.. method:: Path.joinpath(*other)
691714

692715
Return a new Path object with each of the *other* arguments

0 commit comments

Comments
 (0)