[New-bugs-announce] [issue33364] Conditionals not evaluating propertly
Juan Enrique Segebre Zaghmout
report at bugs.python.org
Thu Apr 26 03:02:07 EDT 2018
New submission from Juan Enrique Segebre Zaghmout <juansegebre at gmail.com>:
The following code generates False when it should generate true:
True == False < 20
Either way the order of operation is taken should result in True but the answer still results in False. To further confirm this issue I did a simple test in which we would group the operations, the test uses print statements to visualize results. The short following code represents the above conditional and the two order of operations possibilities.
print(True == False < 20);
print((True == False) < 20);
print(True == (False < 20));
This yields the following output:
False
True
True
Proving the bug. To explain even further, the code shall be interpreted in either of the following two ways:
1. True == False < 20
False < 20
True
2. True == False < 20
True == True
True
In either case the result is True, yet python yields False.
----------
components: Interpreter Core
messages: 315779
nosy: Segebre
priority: normal
severity: normal
status: open
title: Conditionals not evaluating propertly
type: behavior
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33364>
_______________________________________
More information about the New-bugs-announce
mailing list