Q:

Logical paradox in python?

I came over this, where "not None" equals both True and False simultaneously.
>>> not None
True

>>> not None == True
True

>>> not None == False
True

At first I expected that this would be because of the order of operators, but however when testing a similar expression:
>>> not False
True

>>> not False == False
False

>>> not False == True
True

Can anyone explain why this is happening?

A:

This is due to operator precedence. not none == True means not (None == True) means None != True, which is true. Similarly, None != False is also true. The value None is distinct from the booleans.
Your last two expressions mean False != False, which is false, and False != True, which is true.

A:

This is indeed due to operator precedence.  not None == False will be evaluated as not (None == False).  None == False is False, which explains your results.
Try this instead:
>>> (not None) == True
True
>>> (not None) == False
False

