Skip to content
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

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

Open
CameronBieganek opened this issue Dec 13, 2023 · 0 comments
Open

Comments

@CameronBieganek
Copy link
Contributor

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.

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

No branches or pull requests

1 participant