Skip to content

Commit 8d0571f

Browse files
committed
Update glob to prefixmatch
1 parent 3362193 commit 8d0571f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/glob.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ The :mod:`!glob` module defines the following functions:
130130
.. function:: translate(pathname, *, recursive=False, include_hidden=False, seps=None)
131131

132132
Convert the given path specification to a regular expression for use with
133-
:func:`re.match`. The path specification can contain shell-style wildcards.
133+
:func:`re.prefixmatch`. The path specification can contain shell-style
134+
wildcards.
134135

135136
For example:
136137

@@ -140,7 +141,7 @@ The :mod:`!glob` module defines the following functions:
140141
>>> regex
141142
'(?s:(?:.+/)?[^/]*\\.txt)\\z'
142143
>>> reobj = re.compile(regex)
143-
>>> reobj.match('foo/bar/baz.txt')
144+
>>> reobj.prefixmatch('foo/bar/baz.txt')
144145
<re.Match object; span=(0, 15), match='foo/bar/baz.txt'>
145146

146147
Path separators and segments are meaningful to this function, unlike

0 commit comments

Comments
 (0)