Skip to content

Fix typing match groups #4381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion stdlib/2/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,10 @@ class Match(Generic[AnyStr]):
def group(self, group1: int, group2: int, *groups: int) -> Tuple[AnyStr, ...]: ...
@overload
def group(self, group1: str, group2: str, *groups: str) -> Tuple[AnyStr, ...]: ...
def groups(self, default: AnyStr = ...) -> Tuple[AnyStr, ...]: ...
@overload
def groups(self) -> Tuple[Optional[AnyStr], ...]: ...
@overload
def groups(self, default: AnyStr) -> Tuple[AnyStr, ...]: ...
def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ...
def start(self, __group: Union[int, str] = ...) -> int: ...
def end(self, __group: Union[int, str] = ...) -> int: ...
Expand Down
5 changes: 4 additions & 1 deletion stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,10 @@ class Match(Generic[AnyStr]):
def group(self, __group: Union[str, int] = ...) -> AnyStr: ...
@overload
def group(self, __group1: Union[str, int], __group2: Union[str, int], *groups: Union[str, int],) -> Tuple[AnyStr, ...]: ...
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
@overload
def groups(self) -> Sequence[Optional[AnyStr]]: ...
@overload
def groups(self, default: AnyStr) -> Sequence[AnyStr]: ...
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
def start(self, __group: Union[int, str] = ...) -> int: ...
def end(self, __group: Union[int, str] = ...) -> int: ...
Expand Down