Raymond Hettinger <python at 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.