Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python': 0.08; 'design?': 0.09; 'subject:None': 0.09; 'types:': 0.09; 'exception': 0.12; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; '(none': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'rationale': 0.16; 'xavier': 0.16; 'wrote:': 0.16; '>>>': 0.18; 'jan': 0.19; 'header :In-Reply-To:1': 0.22; 'tests': 0.25; 'pm,': 0.26; 'compare': 0.28; 'message-id:@mail.gmail.com': 0.28; 'typeerror:': 0.30; 'tue,': 0.32; 'to:addr:python-list': 0.33; '17,': 0.34; 'received:google.com': 0.37; 'received:209.85': 0.38; 'skip:\xa0 10': 0.38; 'received:209': 0.39; 'expected': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=+5NtKJM+Mg0CT2JN2BxztTWDeCPCbDRfyqKZuw8jWq4=; b=BpfAt5xQ4hMhYbsaNr9qiTzhUpKaidEDl++cPdB5dtRMP4+5BqHFFQ8gSHtPqg/oqW TUMEBeJUK9aaP6si8wUWu+rJY80nRf9CEDJAwtj5LA55YGPFFAFFH9dwdeFcjK5Qx0Bh q30q8/PkJGas6TGomZ930edcbBdAQYBGsnw9I= MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 17 Jan 2012 17:50:43 +1100 Subject: Re: Comparing None and ints From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326783046 news.xs4all.nl 6900 [2001:888:2000:d::a6]:55421 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19053 On Tue, Jan 17, 2012 at 5:47 PM, Xavier Ho wrote: > What was the rationale behind this design? =A0Specifically, (None < 0) = =3D=3D True > and (None =3D=3D 0) =3D=3D False? > > Personally I would have expected an exception on all tests above. Compare with Python 3: >>> None<0 Traceback (most recent call last): File "", line 1, in None<0 TypeError: unorderable types: NoneType() < int() ChrisA