Skip to content

Clarify iterator protocol and .next_back() #30633

Closed
@bluss

Description

@bluss

The iterator protocol documents that behavior on further calls after .next() returns None is open to decide for the implementation. We should clarify in DoubleEndedIterator that .next_back() is to be understood in the same way, and that calls to next and next_back are interchangeable — any of the two may return None, and after that point, the iteration is done the same way.

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