mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix re Pattern.groupindex annotation. (#1106)
This commit is contained in:
committed by
Jelle Zijlstra
parent
671d3870c2
commit
c2cdb1b025
@@ -31,7 +31,7 @@ class SRE_Pattern(object):
|
||||
pattern = ... # type: str
|
||||
flags = ... # type: int
|
||||
groups = ... # type: int
|
||||
groupindex = ... # type: Mapping[int, int]
|
||||
groupindex = ... # type: Mapping[str, int]
|
||||
indexgroup = ... # type: Sequence[int]
|
||||
def findall(self, source: str, pos: int = ..., endpos: int = ...) -> List[Union[tuple, str]]: ...
|
||||
def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[Union[tuple, str]]: ...
|
||||
@@ -44,7 +44,7 @@ class SRE_Pattern(object):
|
||||
|
||||
def compile(pattern: str, flags: int, code: List[int],
|
||||
groups: int = ...,
|
||||
groupindex: Mapping[int, int] = ...,
|
||||
groupindex: Mapping[str, int] = ...,
|
||||
indexgroup: Sequence[int] = ...) -> SRE_Pattern:
|
||||
raise OverflowError()
|
||||
|
||||
|
||||
@@ -438,7 +438,7 @@ class Match(Generic[AnyStr]):
|
||||
|
||||
class Pattern(Generic[AnyStr]):
|
||||
flags = 0
|
||||
groupindex = 0
|
||||
groupindex = ... # type: Mapping[str, int]
|
||||
groups = 0
|
||||
pattern = ... # type: AnyStr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user