Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Few different optimizations work together here. Folding constants at the AST 
level allows to eliminate the constant expression statement in the code 
generation stage. This makes 'continue' a first statement in the 'if' body. 
Boolean expressions optimizations (performed in the code generation stage now) 
creates a conditional jump to the start of the 'if' body (which is 'continue' 
now). If 'continue' is not nested in 'try' or 'with' blocks, it is compiled to 
an unconditional jump. And finally the jump optimization in the peepholer 
retargets the conditional jump from the unconditional jump to the start of the 
loop.

----------

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

Reply via email to