Skip to content

itertools.chain should evaluate lazily #3787

Description

@rng-dynamics

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)))

Activity

  1. youknowone commented on Jun 14, 2022

    @youknowone
    Member

    This test looks missing in CPython

    python/cpython#93815

  2. youknowone commented on Jun 14, 2022

    @youknowone
    Member

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

  3. rng-dynamics commented on Jun 14, 2022

    @rng-dynamics
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions