8000 Rework Match.group handling by srittau · Pull Request #5557 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Rework Match.group handling #5557

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

Merged
merged 4 commits into from
Jun 8, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Handle defaults
  • Loading branch information
srittau committed May 30, 2021
commit bd2c288ce24feecc5adf967f71122916212e42c1
10 changes: 8 additions & 2 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,16 @@ class Match(Generic[AnyStr]):
def group(self, __group1: str | int, __group2: str | int, *groups: str | int) -> Tuple[AnyStr | Any, ...]: ...
# Each item of groups()'s return tuple is either "AnyStr" or
# "AnyStr | None", depending on the pattern.
def groups(self, default: AnyStr = ...) -> Tuple[AnyStr | Any, ...]: ...
@overload
def groups(self) -> Tuple[AnyStr | Any, ...]: ...
@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.
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr | Any]: ...
@overload
def groupdict(self) -> dict[str, AnyStr | Any]: ...
@overload
def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ...
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]: ...
Expand Down
0