Skip to content

Restrict types for stubs in itertools #358

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 4 commits into from
Aug 14, 2014
Merged

Conversation

mvcisback
Copy link
Contributor

Can use Union type to model Maybes and Products.

@mvcisback
Copy link
Contributor Author

Good Catch

This is the kind of situation dependent types where would be particularly useful.
I suspect without them I suspect its impossible to accurately represent product.

It might be better to implement instead separate product2, product3, product4, ... and leave itertool's product with a more general type signature.

For now I'm going to update the PR with Iterator[Sequence[T]].

@mvcisback mvcisback mentioned this pull request Aug 7, 2014
@JukkaL
Copy link
Collaborator

JukkaL commented Aug 14, 2014

Thanks, looks good now! We can iterate on the signatures in the future if the current ones seem too restrictive in practice.

JukkaL added a commit that referenced this pull request Aug 14, 2014
Restrict types for stubs in itertools
@JukkaL JukkaL merged commit 3ba926c into python:master Aug 14, 2014
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.

2 participants