3 ms·
Because that's how the grammar is defined: https://docs.python.org/3.8/reference/grammar.html https://docs.python.org/3.8/reference/grammar.html The RHS of th
by js2 7y ago
Because that's how the grammar is defined:
https://docs.python.org/3.8/reference/grammar.html https://docs.python.org/3.8/reference/grammar.html
The RHS of the == (comp_op) has to be an expr. You can force "not x" to be an expr by parenthesizing it:
x == (not x)
- kccqzy 7y agoThat interesting. On the other hand, not x == x is totally valid.