Thanks to visit codestin.com
Credit goes to github.com

Skip to content

itertools.chain should evaluate lazily #3787

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

Closed
rng-dynamics opened this issue Jun 14, 2022 · 3 comments · Fixed by #3788
Closed

itertools.chain should evaluate lazily #3787

rng-dynamics opened this issue Jun 14, 2022 · 3 comments · Fixed by #3788

Comments

@rng-dynamics
Copy link
Contributor

rng-dynamics commented Jun 14, 2022

CPython:

>>> from itertools import *
>>> a = chain.from_iterable(repeat(range(2)))
>>> next(a)
0
>>> next(a)
1
>>> next(a)
0

RustPython does not evaluate lazily and the call to from_iterable never returns:

>>>>> from itertools import *
>>>>> a = chain.from_iterable(repeat(range(2)))
@youknowone
Copy link
Member

This test looks missing in CPython

python/cpython#93815

@youknowone
Copy link
Member

youknowone commented Jun 14, 2022

Ok, they are not interested in it. We will add it to extra_tests/snippets/stdlib_itertools.py.

@rng-dynamics
Copy link
Contributor Author

Ok, they are not interested in it. We will add it to extra_tests/snippets/stdlib_itertools.py.

In #3788 I added a similar test.

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 a pull request may close this issue.

2 participants