Mark Shannon <m...@hotpy.org> added the comment:

It isn't a specific optimization at all, but the combination of several.
I will change the behavior to match what appears to be the consensus.

BUT, we need to define what the semantics should be. Otherwise implementing the 
compiler is just guesswork.


As for a definition of what is legal, the best I can come up with is:

"Repeated bool() checks of a value in short-circuiting expressions ('and' and 
'or') may be eliminated if the result can be deduced using boolean algebra."

----------

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

Reply via email to