Are there any applicable differences between dict.items() and dict.iteritems()?
From the Python docs:
dict.items(): Return a
The commands dict.items(), dict.keys() and dict.values() return a copy of the dictionary's list of (k, v) pair, keys and values.
This could take a lot of memory if the copied list is very large.
The commands dict.iteritems(), dict.iterkeys() and dict.itervalues() return an iterator over the dictionary’s (k, v) pair, keys and values.
The commands dict.viewitems(), dict.viewkeys() and dict.viewvalues() return the view objects, which can reflect the dictionary's changes.
(I.e. if you del an item or add a (k,v) pair in the dictionary, the view object can automatically change at the same time.)
$ python2.7
>>> d = {'one':1, 'two':2}
>>> type(d.items())
>>> type(d.keys())
>>>
>>>
>>> type(d.iteritems())
>>> type(d.iterkeys())
>>>
>>>
>>> type(d.viewitems())
>>> type(d.viewkeys())
In Py3.x, things are more clean, since there are only dict.items(), dict.keys() and dict.values() available, which return the view objects just as dict.viewitems() in Py2.x did.
Just as @lvc noted, view object isn't the same as iterator, so if you want to return an iterator in Py3.x, you could use iter(dictview) :
$ python3.3
>>> d = {'one':'1', 'two':'2'}
>>> type(d.items())
>>>
>>> type(d.keys())
>>>
>>>
>>> ii = iter(d.items())
>>> type(ii)
>>>
>>> ik = iter(d.keys())
>>> type(ik)