Raymond Hettinger added the comment:

I don't think this should go forward.  The current FOR_ITER and JUMP_ABSOLUTE 
combination is very efficient and shouldn't be changed lightly.  It is the 
inside of the loop that matters -- the GET_ITER step is outside of the loop and 
isn't expensive.

Also, I really like that GET_ITER and FOR_ITER correspond exactly to our high 
level understanding of how for-loops operate:

   for x in s:
       f(x)

corresponds to:

   it = iter(s)
   while True:
       try:
           x = next(it)
       except StopIteration:
           break
       f(x)

I really don't think this should be pursued further.  It messes with my 
understanding of for-loops, it combines features that should remain decoupled, 
it focuses its efforts on the exterior of the loop, and it alters code that is 
very mature (having been examined and tweaked by hundreds of your predecessors).

----------
nosy: +rhettinger

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

Reply via email to