rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.69k stars 303 forks source link

Rename `group_by` into `group_by_consecutive` #833

Closed Kinrany closed 8 months ago

Kinrany commented 8 months ago

group_by only groups consecutive elements and may produce multiple groups with the same key. This fact is very easy to miss, it is easily the biggest footgun in the whole library.

I'd like to propose deprecating this method and making it an alias of a new method, group_by_consecutive.

The new name is not at all elegant, I'd love to come up with something better. But that's probably less important than choosing to deprecate the current name.

Philippe-Cholet commented 8 months ago

We are aware of this, see #374 for the current debate. I know it's an old issue and does not evolve fast enough but it should be resolved eventually there.

So I'm closing this since it's a duplicate.