Skip to content

Commit a2aaace

Browse files
committed
fix candidate for issue python#4380
1 parent 6fbae43 commit a2aaace

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

stdlib/2/typing.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,10 @@ class Match(Generic[AnyStr]):
418418
def group(self, group1: int, group2: int, *groups: int) -> Tuple[AnyStr, ...]: ...
419419
@overload
420420
def group(self, group1: str, group2: str, *groups: str) -> Tuple[AnyStr, ...]: ...
421-
def groups(self, default: AnyStr = ...) -> Tuple[AnyStr, ...]: ...
421+
@overload
422+
def groups(self) -> Tuple[Optional[AnyStr], ...]: ...
423+
@overload
424+
def groups(self, default: AnyStr) -> Tuple[AnyStr, ...]: ...
422425
def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ...
423426
def start(self, __group: Union[int, str] = ...) -> int: ...
424427
def end(self, __group: Union[int, str] = ...) -> int: ...

stdlib/3/typing.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,10 @@ class Match(Generic[AnyStr]):
555555
def group(self, __group: Union[str, int] = ...) -> AnyStr: ...
556556
@overload
557557
def group(self, __group1: Union[str, int], __group2: Union[str, int], *groups: Union[str, int],) -> Tuple[AnyStr, ...]: ...
558-
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
558+
@overload
559+
def groups(self) -> Sequence[Optional[AnyStr]]: ...
560+
@overload
561+
def groups(self, default: AnyStr) -> Sequence[AnyStr]: ...
559562
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
560563
def start(self, __group: Union[int, str] = ...) -> int: ...
561564
def end(self, __group: Union[int, str] = ...) -> int: ...

0 commit comments

Comments
 (0)