Python madness in comparisons with None

In python, everything is greater than None,


>>> 0 > None
True
>>> 0 < None
False

>>> 1 > None
True
>>> 1 < None
False
>>> -1 > None
True
>>> -1 < None
False

>>> 'a' > None
True
>>> 'a' < None
False

>>> 1.0 > None
True
>>> 1.0 < None
False

Comments

Popular posts from this blog

Multiple repeat error when the regex has multiple wildcards in python re module

Weakref proxy is for instance only ...

To speed up accessing files on nfs shares on a ubuntu machine ...