In Python,
1 in {1} == True
is False - why?
I first thought it's due to operator precedence, but all I can find (see below) tells me that the expression is evaluated from left to right:
1 in {1}isTrueTrue == TrueisTrue
Also, any other precedence would lead to a TypeError:
{1} == TrueisFalse1 in Falsereturns aTypeError
Python evaluates expressions from left to right.
https://docs.python.org/3/reference/expressions.html#evaluation-order
Also,
Operators in the same box have the same precedence. [...] Operators in the same box group left to right ([...]).
[...]
https://docs.python.org/3/reference/expressions.html#operator-precedence
