Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19053 > unrolled thread

Re: Comparing None and ints

Started byChris Angelico <rosuav@gmail.com>
First post2012-01-17 17:50 +1100
Last post2012-01-17 17:50 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Comparing None and ints Chris Angelico <rosuav@gmail.com> - 2012-01-17 17:50 +1100

#19053 — Re: Comparing None and ints

FromChris Angelico <rosuav@gmail.com>
Date2012-01-17 17:50 +1100
SubjectRe: Comparing None and ints
Message-ID<mailman.4807.1326783046.27778.python-list@python.org>
On Tue, Jan 17, 2012 at 5:47 PM, Xavier Ho <contact@xavierho.com> 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):
  File "<pyshell#31>", line 1, in <module>
    None<0
TypeError: unorderable types: NoneType() < int()

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web