James Stroud <[EMAIL PROTECTED]> writes: > I defined a little debugging function called iterprint: > > def iterprint(thing): ... > for x in thing: > iterprint(x)
of course this mutates the thing that is being printed. Try using itertools.tee to fork a copy of the iterator and print from that. I didn't look at the rest of your code enough to spot any errors but take note of the warnings in the groupby documentation about pitfalls with using the results some number of times other than exactly once. -- http://mail.python.org/mailman/listinfo/python-list