5 ms·
Probably best not to use iteritems, in python 3, it won't be there, "the dict.iterkeys(), dict.iteritems() and dict.itervalues() methods are no longer supported
by harlowja 14y ago
Probably best not to use iteritems, in python 3, it won't be there, "the dict.iterkeys(), dict.iteritems() and dict.itervalues() methods are no longer supported."
- jsprinkles 14y agoBecause the regularly-named ones got better.
- andreasvc 14y agoThe iter* methods appear in Python 3, just without the iter prefix. Therefore it is good to use them in Python 2 because that makes it possible to translate the code automatically with the 2to3 script. Otherwise possibly superfluous list conversion might get added, e.g., list(d.keys()).
- DasIch 14y ago.keys(), .views() and .items() in Python3 return a memoryview which happen to be iterators but do far more.