mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
Fix annotation of re.Match 'lastindex' and 'lastgroup' in Python 3 (#3085)
Both are None if there were no groups matched. Also 'lastgroup' will be None if the matched group was nameless. The Python 2 versions of these annotations already used Optional.
This commit is contained in:
committed by
Jelle Zijlstra
parent
b0c9fa4530
commit
bdd49d0f3a
@@ -517,8 +517,8 @@ class ByteString(Sequence[int], metaclass=ABCMeta): ...
|
||||
class Match(Generic[AnyStr]):
|
||||
pos = 0
|
||||
endpos = 0
|
||||
lastindex = 0
|
||||
lastgroup: AnyStr
|
||||
lastindex: Optional[int]
|
||||
lastgroup: Optional[AnyStr]
|
||||
string: AnyStr
|
||||
|
||||
# The regular expression object whose match() or search() method produced
|
||||
|
||||
Reference in New Issue
Block a user