From 89e1e5aa7d55a063ff33098c8fb1568a4f82ccae Mon Sep 17 00:00:00 2001 From: Will Frey Date: Mon, 9 Jan 2023 12:12:11 -0500 Subject: [PATCH] Update re.pyi --- stdlib/re.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/re.pyi b/stdlib/re.pyi index 3e52d209eb87..93b152dbe369 100644 --- a/stdlib/re.pyi +++ b/stdlib/re.pyi @@ -72,19 +72,19 @@ class Match(Generic[AnyStr]): @overload def group(self, __group: Literal[0] = ...) -> AnyStr: ... @overload - def group(self, __group: str | int) -> AnyStr | Any: ... + def group(self, __group: str | int) -> AnyStr | None: ... @overload - def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> tuple[AnyStr | Any, ...]: ... + def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> tuple[AnyStr | None, ...]: ... # Each item of groups()'s return tuple is either "AnyStr" or # "AnyStr | None", depending on the pattern. @overload - def groups(self) -> tuple[AnyStr | Any, ...]: ... + def groups(self) -> tuple[AnyStr | None, ...]: ... @overload def groups(self, default: _T) -> tuple[AnyStr | _T, ...]: ... # Each value in groupdict()'s return dict is either "AnyStr" or # "AnyStr | None", depending on the pattern. @overload - def groupdict(self) -> dict[str, AnyStr | Any]: ... + def groupdict(self) -> dict[str, AnyStr | None]: ... @overload def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ... def start(self, __group: int | str = ...) -> int: ... @@ -96,7 +96,7 @@ class Match(Generic[AnyStr]): @overload def __getitem__(self, __key: Literal[0]) -> AnyStr: ... @overload - def __getitem__(self, __key: int | str) -> AnyStr | Any: ... + def __getitem__(self, __key: int | str) -> AnyStr | None: ... def __copy__(self) -> Match[AnyStr]: ... def __deepcopy__(self, __memo: Any) -> Match[AnyStr]: ... if sys.version_info >= (3, 9):