Notice that if you negate a boolean value with not
in comparison with other boolean value or similar, you should put it inside a pair of parenthesis, otherwise you get syntax error:
>>> 0 == not 1
SyntaxError: invalid syntax
>>> 0 == (not 1)
True
>>>