From d3941c24631990b6cbbfc1844358d2311293bc4b Mon Sep 17 00:00:00 2001 From: Joseph Young <80432516+jpy-git@users.noreply.github.com> Date: Wed, 23 Feb 2022 18:38:29 +0000 Subject: [PATCH] regex stubs: Add __getitem__ method to Match (#7372) --- stubs/regex/regex/_regex.pyi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stubs/regex/regex/_regex.pyi b/stubs/regex/regex/_regex.pyi index bb9de6f1a..ee5445fd7 100644 --- a/stubs/regex/regex/_regex.pyi +++ b/stubs/regex/regex/_regex.pyi @@ -172,6 +172,10 @@ class Match(Generic[AnyStr]): def captures(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[AnyStr], ...]: ... def capturesdict(self) -> dict[str, list[AnyStr]]: ... def detach_string(self) -> None: ... + @overload + def __getitem__(self, __key: Literal[0]) -> AnyStr: ... + @overload + def __getitem__(self, __key: int | str) -> AnyStr | Any: ... @final class Splitter(Generic[AnyStr]):