From 0604db48c56a7d9fed10eff6f808efc1fede2dd8 Mon Sep 17 00:00:00 2001 From: arnimarj Date: Mon, 14 Oct 2019 12:31:54 +0000 Subject: [PATCH 1/2] fixing https://github.com/python/typeshed/issues/3361 --- stdlib/3/inspect.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/inspect.pyi b/stdlib/3/inspect.pyi index 099041551d94..975b478287c9 100644 --- a/stdlib/3/inspect.pyi +++ b/stdlib/3/inspect.pyi @@ -187,9 +187,9 @@ def getargspec(func: object) -> ArgSpec: ... FullArgSpec = NamedTuple('FullArgSpec', [('args', List[str]), ('varargs', Optional[str]), ('varkw', Optional[str]), - ('defaults', Tuple[Any, ...]), + ('defaults', Optional[Tuple[Any, ...]]), ('kwonlyargs', List[str]), - ('kwonlydefaults', Dict[str, Any]), + ('kwonlydefaults', Optional[Dict[str, Any]]), ('annotations', Dict[str, Any]), ]) From a2aaacea15efceca4a2eeafc5490be80a81b796d Mon Sep 17 00:00:00 2001 From: arnimarj Date: Fri, 31 Jul 2020 13:47:10 +0000 Subject: [PATCH 2/2] fix candidate for issue #4380 --- stdlib/2/typing.pyi | 5 ++++- stdlib/3/typing.pyi | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stdlib/2/typing.pyi b/stdlib/2/typing.pyi index 360f3d80a107..984a0a0f29f5 100644 --- a/stdlib/2/typing.pyi +++ b/stdlib/2/typing.pyi @@ -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: ... diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 8a302dfe7987..a3a735b12f77 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -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: ...