Cheryl Sabella <chek...@gmail.com> added the comment: It depends upon your use case.
In general, if you want it to work like SQL group by, then yes, it needs to be sorted, and I believe the documentation already covers that. However, there are scenarios where you want to condense a string, but keep the ordering, such as: 'aaaaabbbbbbccccaaaaddd' into '5a6b4c4a3d' and itertools.groupby works very nicely for that. ---------- nosy: +csabella _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32709> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com