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:
5j9
2017-02-10 02:53:52 +03:30
committed by Matthias Kramm
parent f192b8c784
commit 3973f5851a

View File

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