From 5d1aacfed368d85cb05d46b5cdb774f290e4ce09 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 15 Jun 2017 11:13:46 -0700 Subject: [PATCH] special-case overload for itertools.product with 'repeat' (#1410) Add an additional overload for the `repeat = n` case. Since we don't know the numeric value of `repeat`, this just produces an iterator over an arbitrary-length tuple. --- stdlib/2/itertools.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/2/itertools.pyi b/stdlib/2/itertools.pyi index 284047763..9d60526c5 100644 --- a/stdlib/2/itertools.pyi +++ b/stdlib/2/itertools.pyi @@ -128,6 +128,8 @@ def product(iter1: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], iter7: Iterable[Any], *iterables: Iterable) -> Iterator[Tuple]: ... +@overload +def product(*iter: Iterable[_T], repeat: int) -> Iterator[Tuple[_T, ...]]: ... def permutations(iterable: Iterable[_T], r: int = ...) -> Iterator[Sequence[_T]]: ...