Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'operator': 0.03; '"""': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'behaviour.': 0.16; 'buggy': 0.16; 'change;': 0.16; 'docs.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'set,': 0.16; 'tuple': 0.16; 'tuple,': 0.16; 'types,': 0.16; 'index': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'example': 0.22; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'cc:2**0': 0.24; 'equivalent': 0.26; 'shown': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'container': 0.31; "d'aprano": 0.31; 'minor': 0.31; 'steven': 0.31; 'this.': 0.32; 'url:python': 0.33; 'updated': 0.34; 'definition': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:org': 0.36; 'should': 0.36; 'list': 0.37; 'list,': 0.38; 'pm,': 0.38; 'changed': 0.39; 'according': 0.40; 'how': 0.40; 'expression': 0.60; 'url:3': 0.61; "you've": 0.63; 'such': 0.63; 'stated': 0.69; 'jul': 0.74; 'subject:For': 0.78; 'change?': 0.84; 'dict,': 0.84; 'url:reference': 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; bh=i1WBMQgoBp/8IScfDqe3vOPX2cDwHigDfkqPJTJkpCQ=; b=lX19J+4t1xGWge367HwS9l+DE6hZPx8cGJPnWhXVjGJxJOxAHjfsWRg+fwc7rx5c7M 3pROBxLumoDIMmHQubdLtdWABW9dI5cwEJJhs+weOgQAnPpX+QmJzTymwfGbpbZljLqE vYMBq2nPWRb0HdfXDY6K2JVV0fewmji9OkNOp6jyq1Rbp2b7fFQXZWDCVII4HaxZSOWN Q/WRay5q61H+9B0S8KRMExSk/RIJXm/ZW2d45j51wWveFkHjdVyOikfKwyLsoEFhev5W tpvS8JQrv5umRy7Sjw3C7/1KFj8OjSvD4gmu3fcWyIzrtFLluqQqTxgRH9DVuh0w6mlX ytrQ== MIME-Version: 1.0 X-Received: by 10.52.101.168 with SMTP id fh8mr19605340vdb.34.1404888752577; Tue, 08 Jul 2014 23:52:32 -0700 (PDT) In-Reply-To: <53bce483$0$2746$c3e8da3$76491128@news.astraweb.com> References: <53bc26ca$0$29995$c3e8da3$5496439d@news.astraweb.com> <53bc8861$0$29995$c3e8da3$5496439d@news.astraweb.com> <53bce483$0$2746$c3e8da3$76491128@news.astraweb.com> Date: Wed, 9 Jul 2014 16:52:32 +1000 Subject: Re: NaN comparisons - Call For Anecdotes From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404888755 news.xs4all.nl 2971 [2001:888:2000:d::a6]:54974 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74231 On Wed, Jul 9, 2014 at 4:43 PM, Steven D'Aprano wrote: > I don't understand this. You've just shown an example from Python 2 where > 'in' uses 'is'. How is that a Python 3 change? A docs change. https://docs.python.org/2/reference/expressions.html#not-in """ For the list and tuple types, x in y is true if and only if there exists an index i such that x == y[i] is true. """ https://docs.python.org/3/reference/expressions.html#not-in """ For container types such as list, tuple, set, frozenset, dict, or collections.deque, the expression x in y is equivalent to any(x is e or x == e for e in y). """ So the definition of the operator (as stated in the docs) has changed to match its behaviour. That's definitely a change; the Py2 behaviour is buggy according to its docs. Should the Py2 docs be updated to match the Py3 docs, or should it be left as a minor technical distinction that almost never is important? ChrisA