Skip to content

5-ary izip #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion stdlib/2/itertools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ _T1 = TypeVar('_T1')
_T2 = TypeVar('_T2')
_T3 = TypeVar('_T3')
_T4 = TypeVar('_T4')
_T5 = TypeVar('_T5')
_T6 = TypeVar('_T6')

@overload
def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ...
Expand All @@ -71,7 +73,20 @@ def izip(iter1: Iterable[_T1], iter2: Iterable[_T2],
@overload
def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2,
_T3, _T4]]: ... # TODO more than four iterables
_T3, _T4]]: ...
@overload
def izip(iter1: Iterable[_T1], iter2: Iterable[_T2],
iter3: Iterable[_T3], iter4: Iterable[_T4],
iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2,
_T3, _T4, _T5]]: ...
@overload
def izip(iter1: Iterable[_T1], iter2: Iterable[_T2],
iter3: Iterable[_T3], iter4: Iterable[_T4],
iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3,
_T4, _T5, _T6]]: ...
# TODO more than 6 iterables
# TODO should have a fallback for the n-ary variant

def izip_longest(*p: Iterable[Any],
fillvalue: Any = ...) -> Iterator[Any]: ...

Expand Down