Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 6eadc27

Browse files
committed
re.Match: remove any from group functions
1 parent f52932c commit 6eadc27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/re.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ class Match(Generic[AnyStr]):
7474
@overload
7575
def group(self, __group: Literal[0] = 0) -> AnyStr: ...
7676
@overload
77-
def group(self, __group: str | int) -> AnyStr | Any: ...
77+
def group(self, __group: str | int) -> AnyStr | None: ...
7878
@overload
79-
def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> tuple[AnyStr | Any, ...]: ...
79+
def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> tuple[AnyStr | None, ...]: ...
8080
# Each item of groups()'s return tuple is either "AnyStr" or
8181
# "AnyStr | None", depending on the pattern.
8282
@overload
83-
def groups(self) -> tuple[AnyStr | Any, ...]: ...
83+
def groups(self) -> tuple[AnyStr | None, ...]: ...
8484
@overload
8585
def groups(self, default: _T) -> tuple[AnyStr | _T, ...]: ...
8686
# Each value in groupdict()'s return dict is either "AnyStr" or
8787
# "AnyStr | None", depending on the pattern.
8888
@overload
89-
def groupdict(self) -> dict[str, AnyStr | Any]: ...
89+
def groupdict(self) -> dict[str, AnyStr | None]: ...
9090
@overload
9191
def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ...
9292
def start(self, __group: int | str = 0) -> int: ...
@@ -98,7 +98,7 @@ class Match(Generic[AnyStr]):
9898
@overload
9999
def __getitem__(self, __key: Literal[0]) -> AnyStr: ...
100100
@overload
101-
def __getitem__(self, __key: int | str) -> AnyStr | Any: ...
101+
def __getitem__(self, __key: int | str) -> AnyStr | None: ...
102102
def __copy__(self) -> Match[AnyStr]: ...
103103
def __deepcopy__(self, __memo: Any) -> Match[AnyStr]: ...
104104
if sys.version_info >= (3, 9):

0 commit comments

Comments
 (0)