mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Define __getitem__ for Match objects of Python 3.6 (#925)
In Python 3.6 __getitem__ was added as a new method for match objects. m[g] is identical to m.group(g).
This commit is contained in:
@@ -421,6 +421,8 @@ class Match(Generic[AnyStr]):
|
||||
def start(self, group: Union[int, str] = ...) -> int: ...
|
||||
def end(self, group: Union[int, str] = ...) -> int: ...
|
||||
def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def __getitem__(self, g: Union[int, str]) -> AnyStr: ...
|
||||
|
||||
class Pattern(Generic[AnyStr]):
|
||||
flags = 0
|
||||
|
||||
Reference in New Issue
Block a user