[Python-3000] Default dict iterator should have been iteritems() (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Tue Sep 4 22:44:45 CEST 2007
- Previous message: [Python-3000] Default dict iterator should have been iteritems()
- Next message: [Python-3000] Default dict iterator should have been iteritems()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Noam Raphael wrote:
Just out of curiousity - do you remember these reasons?
I don't remember the discussion in detail, but a couple of reasons that come to mind:
It would be confusing to have "x in d" and "for x in d" meaning subtly different things.
It's more efficient to iterate over just the keys, because a tuple has to be created for each item when iterating over (key, value) pairs. It's reasonable that if you want more done, you should have to write more to get it.
-- Greg
- Previous message: [Python-3000] Default dict iterator should have been iteritems()
- Next message: [Python-3000] Default dict iterator should have been iteritems()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]