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

Splitting python path using os.path module

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

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