[New-bugs-announce] [issue13363] Many usages of dict.keys(), dict.values(), dict.items() when the iter version could be used
report at bugs.python.org
Mon Nov 7 04:11:56 CET 2011
New submission from skreft <skreft at gmail.com>:
In Python 2.7, there are many patterns of the form
for x in mapping.(keys()|values()|items()):
when the iterator version of those method could be used.
Is there any reason for using those methods?
I see that in some other parts of the code the iterator version is used. Here is the summary:
Non iter version Iter version
Keys 160 21
Values 35 23
Items 249 79
I sued the following command
$ egrep -R "for.*[.]iterkeys\(\)" . | wc -l
What's the position about this? Does it worth it to fix this?
title: Many usages of dict.keys(), dict.values(), dict.items() when the iter version could be used
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce