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.
This commit is contained in:
Matthias Kramm
2017-06-15 11:13:46 -07:00
committed by Jukka Lehtosalo
parent 4fbdcf5b03
commit 5d1aacfed3

View File

@@ -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]]: ...