Comment by gcbirzan
3 days ago
There's also itertools.groupby, maybe not much shorter (need to define the keyfunc, sort, then iterate), but it does make the intent obvious.
3 days ago
There's also itertools.groupby, maybe not much shorter (need to define the keyfunc, sort, then iterate), but it does make the intent obvious.
No comments yet
Contribute on Hacker News ↗