Skip to content

Add zip stubs for 5 and more arguments. #1041

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 2 commits into from
Mar 20, 2017

Conversation

sproshev
Copy link
Contributor

@sproshev sproshev commented Mar 20, 2017

Currently there are no stubs for zip with 5+ arguments.
So I added detailed stub for 5 arguments and very simple stub for 6+ arguments. I think it would be enough.

@overload
def zip(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any],
iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any],
*iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just do something like

@overload
def zip(*iter: Iterable) -> List[tuple]: ...

for the 5+ arg case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried with

@overload
def zip(*iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ...

and it failed. See https://travis-ci.org/python/typeshed/jobs/212982069

@gvanrossum
Copy link
Member

LGTM. Eventually this will be superseded by variadic type variables (python/typing#193).

@matthiaskramm matthiaskramm merged commit 25c66a0 into python:master Mar 20, 2017
@sproshev sproshev mentioned this pull request Mar 21, 2017
@sproshev sproshev deleted the sproshev/builtin-zip branch March 21, 2017 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants