can some explain why in the 2nd example, m doesn't print the list [1, 1, 1] which i had expected?
>>> for k, g in groupby([1, 1, 1, 2, 2, 3]): ... print k, list(g) ... 1 [1, 1, 1] 2 [2, 2] 3 [3] >>> m = list(groupby([1, 1, 1, 2, 2, 3])) >>> m [(1, <itertools._grouper object at 0x00AAC600>), (2, <itertools._grouper object at 0x00AAC5A0>), (3, <itertools._grouper object at 0x00AAC5B0>)] >>> list(m[0][1]) [] >>> thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list