Skip to content

add back 'repeat' argument to itertools.product #1407

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 1 commit into from
Jun 14, 2017
Merged

Conversation

matthiaskramm
Copy link
Contributor

No description provided.

@gvanrossum gvanrossum merged commit d5e7663 into master Jun 14, 2017
@gvanrossum gvanrossum deleted the itertools branch June 14, 2017 16:33
@JelleZijlstra
Copy link
Member

Interesting that keyword-only arguments work in Python 2 stubs.

@JukkaL
Copy link
Contributor

JukkaL commented Jun 14, 2017

The return types are now wrong, since the value of repeat affects the return type. Example:

>>> list(product((1, 2), (3, 4), repeat=2))
[(1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4), (1, 4, 1, 3), (1, 4, 1, 4), (1, 4, 2, 3), (1, 4, 2, 4), (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4), (2, 4, 1, 3), (2, 4, 1, 4), (2, 4, 2, 3), (2, 4, 2, 4)]

This is way the signature was imprecise before. Maybe add separate overload variants with repeat that have less precise return types?

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.

4 participants