Hello,

I discovered this strange property by accident:

Python 2.7.2 (default, Nov 21 2011, 17:25:27)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> None < 0
True
>>> None == 0
False
>>> None > 0
False
>>> int(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: int() argument must be a string or a number, not 'NoneType'

What was the rationale behind this design?  Specifically, (None < 0)
== Trueand(None == 0) == False
?

Personally I would have expected an exception on all tests above.

Cheers,
Xav
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to