8000 Regex Match.group returns None by djb4ai · Pull Request #3914 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Regex Match.group returns None #3914

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 2 commits into from
Closed
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
Next Next commit
Add overloaded methods for return type of None
  • Loading branch information
djb4ai committed Apr 7, 2020
commit e820d8c1d50f3d9b29c00182274cd38d93aa5fb0
6 changes: 5 additions & 1 deletion stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,11 @@ class Match(Generic[AnyStr]):

# TODO: The return for a group may be None, except if __group is 0 or not given.
@overload
def group(self, __group: Union[str, int] = ...) -> AnyStr: ...
def group(self, __group: Literal[None]= ...) -> AnyStr: ...
@overload
def group(self, __group: Literal[0]= ...) -> AnyStr: ...
@overload
def group(self, __group: Union[str, int] = ...) -> Optional[AnyStr]: ...
@overload
def group(
self,
Expand Down
0