The purpose of .iteritems()
was to use less memory space by yielding one result at a time while looping. I am not sure why Python 3 version does not support iteritems()
though it's been proved to be efficient than .items()
If you want to include a code that supports both the PY version 2 and 3,
try:
iteritems
except NameError:
iteritems = items
This can help if you deploy your project in some other system and you aren't sure about the PY version.