Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'element': 0.07; '*is*': 0.09; 'operator,': 0.09; 'overflow': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'used.': 0.09; 'jan': 0.12; '"in"': 0.16; 'container.': 0.16; 'dict': 0.16; 'effect,': 0.16; 'nans': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'reflects': 0.16; 'tuples,': 0.16; 'wrote:': 0.18; 'stack': 0.19; 'header:User- Agent:1': 0.23; 'specify': 0.24; 'question': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'testing': 0.29; '(on': 0.31; 'container': 0.31; 'developers.': 0.31; 'equality': 0.31; 'core': 0.34; 'subject: (': 0.35; 'subject:?': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'intentions': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Is nan in (nan,) correct? Date: Thu, 05 Mar 2015 20:20:23 -0500 References: <1425594413.2960487.236174005.017A4298@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: <1425594413.2960487.236174005.017A4298@webmail.messagingengine.com> 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1425604850 news.xs4all.nl 2829 [2001:888:2000:d::a6]:47926 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86970 Nothing about nans is 'correct'. They are a CS invention On 3/5/2015 5:26 PM, random832@fastmail.us wrote: > It's been brought up on Stack Overflow that the "in" operator (on > tuples, and by my testing on dict and list, as well as dict lookup) uses > object identity as a shortcut, and returns true immediately if the > object being tested *is* an element of the container. However, the > contains operation does not specify whether object identity or equality > is to be used. In effect, the built-in container types use a hybrid > test: "a is b or a == b". > > My question is, is this a *correct* implementation of the operator, The current implementation of 'in' is 'correct' in that it reflects the intentions of GvR and other core developers. -- Terry Jan Reedy