Gregor Horvath wrote:
 >>> None <= 0
True

More accurately:

None < 0
True

Why?
Is there a logical reason?

None is "less than" everything except for itself:

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

In my humble opinion, I think that comparisons involving None should return None, but I trust that the designers came up with this for very good reasons. As far as I know I've never been bitten by it.

Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to