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 order guarantees for combinations #822

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

ryanavella
Copy link
Contributor

@ryanavella ryanavella commented Dec 15, 2023

Fixes #819 by documenting the order guarantees for Itertools adapters.

@Philippe-Cholet
Copy link
Member

CI failed because rustfmt does not accept trailing spaces.

The question is if we want this guarantee to be library wide or limited to some adaptors like Combinations. I'll let @jswrenn decide on that.

@ryanavella
Copy link
Contributor Author

The question is if we want this guarantee to be library wide or limited to some adaptors like Combinations. I'll let @jswrenn decide on that.

Ah yes, I hope I didn't misunderstand the conclusion from the other issue. I originally wanted a guarantee for Combination-like adapters, but I interpreted your comments as saying we don't intend to break iteration order for any adapters.

I could add a blanket "unless otherwise noted" clause, if there are specific adapters we'd like to leave open to further optimizations?

@jswrenn
Copy link
Member

jswrenn commented Dec 19, 2023

Sorry for the misunderstanding. I don't think we can guarantee order for all adaptors, but I am okay guaranteeing it for the combinations adaptors.

@ryanavella ryanavella force-pushed the master branch 2 times, most recently from acf190e to cb56ed1 Compare December 23, 2023 19:28
@ryanavella
Copy link
Contributor Author

Thank you for the clarification, I've updated this PR so that the guarantee is only shown under Itertools::combinations and Itertools::tuple_combinations. Let me know if all looks good to you.

@Philippe-Cholet Philippe-Cholet changed the title Document order guarantees for Itertools adapters. Document order guarantees for combinations Jan 7, 2024
@Philippe-Cholet
Copy link
Member

@jswrenn What do you think of his formulation?

Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, I had a draft review I thought I had posted. Thanks for the ping. It's just some minor nits.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@Philippe-Cholet
Copy link
Member

Philippe-Cholet commented Jan 9, 2024

@ryanavella If you could commit jswrenn' suggestions and squash into a single commit, I would gladly merge this.

EDIT: Done.

@Philippe-Cholet
Copy link
Member

@jswrenn My approval is not enough to get this merged.

@jswrenn jswrenn added this pull request to the merge queue Jan 11, 2024
Merged via the queue into rust-itertools:master with commit 2f4739c Jan 11, 2024
8 checks passed
@Philippe-Cholet Philippe-Cholet added this to the next milestone Jan 11, 2024
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 this pull request may close these issues.

Can the order of Combinations be relied on?
3 participants