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

Drew olsonas at gmail.com
Wed Mar 14 15:14:00 EDT 2007


On Mar 14, 2:53 pm, s... at pobox.com wrote:
>     >> When is it appropriate to use dict.items() vs dict.iteritems.
>
>     Laurent> Both work, you may prefer xrange/iteritems for iteration on
>     Laurent> large collections...
>
> I find "iter<anything>" to be extremely ugly and hope to avoid using them
> altogether until they are gone in Py3k.
>
> Skip

Skip -

Ugly, maybe, but don't you take a decent performance hit when loading
the entire dict into memory at once? Especially if the dict is large?




More information about the Python-list mailing list