From d6cbb615870050cfaca2f7db2ed4bb624b08c152 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Sat, 1 Dec 2018 03:39:50 +0530 Subject: [PATCH 1/2] itertools.pyi: Add overload to Python 3 Fixes #2561 --- stdlib/3/itertools.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/3/itertools.pyi b/stdlib/3/itertools.pyi index 8ca88cf92ab1..1c366a603578 100644 --- a/stdlib/3/itertools.pyi +++ b/stdlib/3/itertools.pyi @@ -97,6 +97,8 @@ def product(iter1: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... @overload def product(*iterables: Iterable[Any], repeat: int) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*, repeat: int = ...) -> Iterable[Tuple[()]]: ... def permutations(iterable: Iterable[_T], r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ... From 49ab2ba12857f44f51f53039e7a81c458d0c7d4e Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Sat, 1 Dec 2018 04:10:41 +0530 Subject: [PATCH 2/2] itertools.pyi: Add overload to Python 3 Fixes #2561 --- stdlib/3/itertools.pyi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stdlib/3/itertools.pyi b/stdlib/3/itertools.pyi index 1c366a603578..443244a56a16 100644 --- a/stdlib/3/itertools.pyi +++ b/stdlib/3/itertools.pyi @@ -96,9 +96,7 @@ def product(iter1: Iterable[Any], iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... @overload -def product(*iterables: Iterable[Any], repeat: int) -> Iterator[Tuple[Any, ...]]: ... -@overload -def product(*, repeat: int = ...) -> Iterable[Tuple[()]]: ... +def product(*iterables: Iterable[Any], repeat: int = ...) -> Iterator[Tuple[Any, ...]]: ... def permutations(iterable: Iterable[_T], r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ...