A senior of mine demonstrated it and I want to know if this is a flaw or is there some precedence and operator associativity stuff that justifies it.
>>> False==False in [False]
True
A senior of mine demonstrated it and I want to know if this is a flaw or is there some precedence and operator associativity stuff that justifies it.
>>> False==False in [False]
True
Python's comparison operators chain.
False == False in [False]
is evaluated as
(False == False) and (False in [False])
The middle term participates in both comparisons.
I would prefer that in
not chain with the other comparison operators.