Skip to content

Document iterators that iterate elements in a well-defined order #52518

@CameronBieganek

Description

@CameronBieganek

An old comment from Keno says that "iterators don't in general have a strong guarantee over their ordering". This seems like a large gap in our documentation. Looking at the docstring for UnitRange, there is no mention of the iteration order. So the following code is undefined:

x, y = 1:2

There's no guarantee that x == 1 and y == 2.

I propose that we update the docstrings for the various iterators in Base to make it clear which iterators have a well-defined iteration order. Perhaps we could use the word sequence to describe iterators with a well-defined iteration order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis change adds or pertains to documentationiterationInvolves iteration or the iteration protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions