[issue4715] optimize bytecode for conditional branches

Antoine Pitrou report at bugs.python.org
Wed Jan 14 12:17:45 CET 2009


Antoine Pitrou <pitrou at free.fr> added the comment:

> Your change to the "LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP"
> optimization doesn't preserve the optimization to:
>   def f():
>     return 1 and a
> I suspect we don't care since "0 or a" wasn't optimized.

Yes, this optimization seems meant for "while 1" and "while True" mainly
(which my patch preserves, but I might add a comment).

> I wonder what the "POP_TOP JUMP_FORWARD 1 POP_TOP" was ever for. Why did
> compiler_comprehension_generator() emit it in the first place?

I'm as clueless as you...

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4715>
_______________________________________


More information about the Python-bugs-list mailing list