New submission from skreft <skr...@gmail.com>:

In Python 2.7, there are many patterns of the form

for x in mapping.(keys()|values()|items()):
    #code
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?

----------
messages: 147199
nosy: skreft
priority: normal
severity: normal
status: open
title: Many usages of dict.keys(), dict.values(), dict.items() when the iter 
version could be used
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13363>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to