Closed srus closed 9 years ago
Use iteritems() instead of items() to iterate over a list. Better memory footprint since it uses an Iterator object instead of creating a new list. This is the default behaviour for items() in Python 3.x.
iteritems()
items()
See https://docs.python.org/2/library/stdtypes.html#dict.iteritems
@srus: Thanks
Use
iteritems()
instead ofitems()
to iterate over a list. Better memory footprint since it uses an Iterator object instead of creating a new list. This is the default behaviour foritems()
in Python 3.x.See https://docs.python.org/2/library/stdtypes.html#dict.iteritems