quantifiedcode / python-anti-patterns

An open collection of Python anti-patterns and worst practices.
https://quantifiedcode.github.io/python-anti-patterns
Other
1.71k stars 249 forks source link

iteritems improvement #43

Open JensRantil opened 9 years ago

JensRantil commented 9 years ago

http://docs.quantifiedcode.com/python-anti-patterns/performance/not_using_iteritems_to_iterate_large_dict.html should probably also mention that using items() isn't an anti-pattern in Python in which iteritems() has been removed and items() always returns an iterator.

smartsammler commented 6 years ago

Since using Python 2 nowadays is in a way an anti-pattern, one shouldn't recommend using iteritems() any more. And one shouldn't write xrange() any more, too.

-- Sorry I haven't seen the Python 3 hint in the text, and saw this open issue.