Skip to content
Merged
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
18 changes: 11 additions & 7 deletions stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ from abc import abstractmethod, ABCMeta
from types import CodeType, FrameType, TracebackType
import collections # Needed by aliases like DefaultDict, see mypy issue 2986

if sys.version_info < (3, 8):
from typing_extensions import Literal

# Definitions of special type checking related constructs. Their definition
# are not used, so their value does not matter.

Expand Down Expand Up @@ -526,15 +529,16 @@ class Match(Generic[AnyStr]):
def expand(self, template: AnyStr) -> AnyStr: ...

@overload
def group(self, group1: int = ...) -> AnyStr: ...
@overload
def group(self, group1: str) -> AnyStr: ...
def group(self, __group: Literal[0] = ...) -> AnyStr: ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the @overload decorator

@overload
def group(self, group1: int, group2: int,
*groups: int) -> Sequence[AnyStr]: ...
def group(self, __group: Union[str, int]) -> Optional[AnyStr]: ...
@overload
def group(self, group1: str, group2: str,
*groups: str) -> Sequence[AnyStr]: ...
def group(
self,
__group1: Union[str, int],
__group2: Union[str, int],
*groups: Union[str, int],
) -> Tuple[Optional[AnyStr], ...]: ...

def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
Expand Down