itertools.groupby explained.
itertools.groupby
Really nice: [2, a, b, 1, c, 3, d, e, f] ⇒ [[2, a, b], [1, c], [3, d, e, f]]
[2, a, b, 1, c, 3, d, e, f]
[[2, a, b], [1, c], [3, d, e, f]]
Really silly: List comprehension with state.