[issue46703] boolean operation issue (True == False == False)

Pablo Galindo Salgado report at bugs.python.org
Wed Feb 9 20:09:08 EST 2022


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

This is not a bug. Please check the docs on the ternary operator:

https://docs.python.org/3/reference/expressions.html#comparisons

In particular:

Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y and y <= z, except that y is evaluated only once (but in both cases z is not evaluated at all when x < y is found to be false).



THis means that

True == False == False is really True == False and False == False wich is False and True which is False

----------

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


More information about the Python-bugs-list mailing list