Fix re Pattern.groupindex annotation. (#1106)

This commit is contained in:
George King
2017-03-27 23:45:51 -04:00
committed by Jelle Zijlstra
parent 671d3870c2
commit c2cdb1b025
2 changed files with 3 additions and 3 deletions

View File

@@ -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()

View File

@@ -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