Re: Comparing None and ints

2012-01-16 Thread Chris Angelico
On Tue, Jan 17, 2012 at 5:55 PM, Xavier Ho wrote: > Good to see Python3 got rid of that confusion :] Yep. Obviously you can still test for equality (they're not equal, of course), but now they're non-ordered. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing None and ints

2012-01-16 Thread Xavier Ho
Good to see Python3 got rid of that confusion :] Cheers, Xav On 17 January 2012 16:50, Chris Angelico wrote: > On Tue, Jan 17, 2012 at 5:47 PM, Xavier Ho wrote: > > What was the rationale behind this design? Specifically, (None < 0) == > True > > and (None == 0) == False? > > > > Personally

Re: Comparing None and ints

2012-01-16 Thread Chris Angelico
On Tue, Jan 17, 2012 at 5:47 PM, Xavier Ho wrote: > What was the rationale behind this design?  Specifically, (None < 0) == True > and (None == 0) == False? > > Personally I would have expected an exception on all tests above. Compare with Python 3: >>> None<0 Traceback (most recent call last):

Comparing None and ints

2012-01-16 Thread Xavier Ho
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