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

Drew olsonas at gmail.com
Wed Mar 14 11:49:21 EDT 2007


On Mar 14, 11:44 am, Laurent Pointal <laurent.poin... at limsi.fr> wrote:
> Both work, you may prefer xrange/iteritems for iteration on large
> collections, you may prefer range/items when processing of the result
> value explicitly need a list (ex. calculate its length) or when you are
> going to manipulate the original container in the loop.
>
> A+
>
> Laurent.

Laurent -

Extremely helpful, exactly what I was looking for.

Thanks,
Drew




More information about the Python-list mailing list