Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'interpreter': 0.05; 'url:pipermail': 0.05; 'assuming': 0.09; 'correct,': 0.09; 'topic:': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'discusses': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'implies': 0.16; 'nick': 0.16; 'python-dev,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'compare': 0.26; 'specially': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'correct': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'steven': 0.31; 'url:python': 0.33; 'fri,': 0.33; 'problem': 0.35; 'subject: (': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'url:org': 0.36; 'example,': 0.37; 'being': 0.38; 'ben': 0.38; 'needed': 0.38; 'issue': 0.38; 'pm,': 0.38; 'sure': 0.39; 'url:mail': 0.40; 'is.': 0.60; 'skip:\xe2 10': 0.65; 'mar': 0.68; '8bit%:43': 0.74; '2015': 0.84; 'optimisation': 0.84; 'url:python-dev': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=SGgMhp3Msm3TAPNgy9uWcqR8cDdRwkyReic9O2P98x8=; b=uARFuwjvkoFFgsd1GbNrbVcsJb8V0ds6/WlNqrEfKpflkxXLcg6CVW3xrrtW8WnH96 Z8PdNUf/Mpczuer/CnweHybD3Y/jT0KpHTdaJwACl9rgmNdVC616UkOO0PaGGJAF8jdm nmUHRlCxFgytOrccvpIsz300B70V0YSJB0POXxfuYz4YfevGL3mKqtbOVglSTLcW24JF MJX3AhToAYBFz+umlLw8K4tKyhajWwvji+/wywluoKDTgSwt6424nTRCDSTaO9C3o6dc 7tsUUfdgAudp/U98orHG+L8X+Z9kKUUrfPqVHPiOZxf+bg8sxz3O8IxMoTFdOp+9cxre 7v6A== MIME-Version: 1.0 X-Received: by 10.42.203.147 with SMTP id fi19mr7827697icb.12.1425613742469; Thu, 05 Mar 2015 19:49:02 -0800 (PST) In-Reply-To: <85wq2uyffs.fsf@benfinney.id.au> References: <54f90c53$0$12994$c3e8da3$5496439d@news.astraweb.com> <858ufazvff.fsf@benfinney.id.au> <54F91C70.6020303@stoneleaf.us> <85wq2uyffs.fsf@benfinney.id.au> Date: Fri, 6 Mar 2015 14:49:02 +1100 Subject: Re: Is nan in (nan,) correct? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1425613750 news.xs4all.nl 2947 [2001:888:2000:d::a6]:58890 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:86981 On Fri, Mar 6, 2015 at 2:26 PM, Ben Finney wro= te: > Isn't the point at issue that the Python interpreter *may* optimise by > assuming =E2=80=98is implies equality=E2=80=99, so the =E2=80=98in=E2=80= =99 operator can fail if that > assumption is false? > > I thought the problem was that types with custom behaviour, as with the > =E2=80=98NullType=E2=80=99 example, needed to deal specially with the =E2= =80=98is implies > equality=E2=80=99 optimisation Steven explained. > > If that's the correct behaviour, and we can *depend* on it being > correct, then I don't see what the problem is. I'm not sure it's just an optimization. Compare this post from python-dev, where Nick Coghlan discusses the same topic: https://mail.python.org/pipermail/python-dev/2014-July/135476.html ChrisA