I tried some comparisons with None
. Here are the tests -
1 > None
2 > None
0 > None
-100000 > None
All comparisons returned True
. Why did this happen? Why did NoneType
comparisons work with intType
? Will the results be True
in all cases?
Is it good coding practice to use None
in comparisons?
Note: the comparisons only worked in Python 2.x. Python 3.x doesn't seem to support the comparisons (tested on Python 2.7.6 and Python 3.4.0).