0

In Python, why is None nonpositive?

>>> None >  0  # False
>>> None >= 0  # False
>>> None <  0  # True
>>> None <= 0  # True

I could hypothetically see None being coerced to a False and then a False vs 0 comparison, but that's not what's happening...

>>> False >  0 # False
>>> False >= 0 # True
>>> False <  0 # False
>>> False <= 0 # True

...where the truth table for False is consistent with 0 on the left hand side.

Someone please elucidate the coercions producing None < 0 being True

Rhys Ulerich
  • 1,180
  • 11
  • 28

0 Answers0