dict.items() vs dict.iteritems and similar questions

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Mar 15 14:43:24 EDT 2007


Alex Martelli:

> Right.  However, "return sum(1 for _ in iterator)" may be a handier way
> to express the same desctructive semantics as the last 4 lines here.

With the speed tests I have done my version did come out as the faster
one.

Bye,
bearophile




More information about the Python-list mailing list