istg, python, what are you doing: https://docs.python.org/3/library/itertools.html#itertools.groupby The operation of groupby() is similar to the uniq filter in Unix. It generates a break or new group every time the value of the key function changes (which is why it is usually necessary to have sorted the data using the same key function). That behavior differs from SQL’s GROUP BY which aggregates common elements regardless of their input order. Why is this footgun in the standard library. The year is 2026. We have moved past the need for unsafe uniqs.