From f3818cabbcdcc979d12e032f1aa8fc3712e682c6 Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Wed, 10 Aug 2016 21:09:16 +0200 Subject: [PATCH] Handle passing a tuple of types to issubclass() (#459) It can't be just any sequence hence Tuple is used instead of previously mentioned Sequence. --- stdlib/2.7/__builtin__.pyi | 4 +--- stdlib/3/builtins.pyi | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stdlib/2.7/__builtin__.pyi b/stdlib/2.7/__builtin__.pyi index 5d7674201..8b0ee5318 100644 --- a/stdlib/2.7/__builtin__.pyi +++ b/stdlib/2.7/__builtin__.pyi @@ -693,9 +693,7 @@ def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... @overload def iter(function: Callable[[], _T], sentinel: _T) -> Iterator[_T]: ... def isinstance(o: object, t: Union[type, Tuple[type, ...]]) -> bool: ... -def issubclass(cls: type, classinfo: type) -> bool: ... -# TODO support this -#def issubclass(type cld, classinfo: Sequence[type]) -> bool: ... +def issubclass(cls: type, classinfo: Union[type, Tuple[type, ...]]) -> bool: ... def len(o: Sized) -> int: ... @overload def map(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> List[_S]: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 22d9b9cce..16e8c0f4e 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -670,9 +670,7 @@ def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... @overload def iter(function: Callable[[], _T], sentinel: _T) -> Iterator[_T]: ... def isinstance(o: object, t: Union[type, Tuple[type, ...]]) -> bool: ... -def issubclass(cls: type, classinfo: type) -> bool: ... -# TODO support this -#def issubclass(type cld, classinfo: Sequence[type]) -> bool: ... +def issubclass(cls: type, classinfo: Union[type, Tuple[type, ...]]) -> bool: ... def len(o: Sized) -> int: ... def license() -> None: ... def locals() -> Dict[str, Any]: ...