Raymond Hettinger <pyt...@rcn.com> writes: > This code consumes an iterator to exhaustion. > It is short, sweet, and hard to beat.
I've always used sum(1 for x in iterator) or some such. -- http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger <pyt...@rcn.com> writes: > This code consumes an iterator to exhaustion. > It is short, sweet, and hard to beat.
I've always used sum(1 for x in iterator) or some such. -- http://mail.python.org/mailman/listinfo/python-list