Skip to content

Commit

Permalink
Note difference in empty pattern handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Jan 23, 2024
1 parent 5c2ea0e commit a5eaf81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,10 @@ Pure paths provide the following methods and properties:
Match this path against the provided non-recursive glob-style pattern.
Return ``True`` if matching is successful, ``False`` otherwise.

This method is similar to :meth:`~PurePath.full_match`, but the recursive
wildcard "``**``" is not supported (it acts like non-recursive "``*``"),
and if a relative pattern is given, then matching is done from the right::
This method is similar to :meth:`~PurePath.full_match`, but empty patterns
aren't allowed (:exc:`ValueError` is raised), the recursive wildcard
"``**``" isn't supported (it acts like non-recursive "``*``"), and if a
relative pattern is provided, then matching is done from the right::

>>> PurePath('a/b.py').match('*.py')
True
Expand Down

0 comments on commit a5eaf81

Please sign in to comment.