[issue42899] Is it legal to eliminate tests of a value, when that test has no effect on control flow?

Serhiy Storchaka report at bugs.python.org
Tue Jan 12 07:23:48 EST 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you Steve. Yes, this is what I meant. "if a and b" is so common that we sacrifice literal translation for the sake of performance.

"if" with an empty block looks pretty uncommon to me. It is not worth to optimize this case specially (especially if it changes semantic). What are real world examples for which it makes sense to replace POP_JUMP_IF_FALSE with POP_TOP?

----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42899>
_______________________________________


More information about the Python-bugs-list mailing list