Skip to content

Commit 5d1aacf

Browse files
matthiaskrammJukkaL
authored andcommitted
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.
1 parent 4fbdcf5 commit 5d1aacf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

stdlib/2/itertools.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def product(iter1: Iterable[Any],
128128
iter5: Iterable[Any],
129129
iter6: Iterable[Any],
130130
iter7: Iterable[Any], *iterables: Iterable) -> Iterator[Tuple]: ...
131+
@overload
132+
def product(*iter: Iterable[_T], repeat: int) -> Iterator[Tuple[_T, ...]]: ...
131133

132134
def permutations(iterable: Iterable[_T],
133135
r: int = ...) -> Iterator[Sequence[_T]]: ...

0 commit comments

Comments
 (0)