Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'operator': 0.03; 'stating': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'behave': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operands': 0.16; 'operator.': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'feb': 0.22; '>>>': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'tells': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'define': 0.26; 'header:In-Reply- To:1': 0.27; 'chris': 0.29; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; 'that.': 0.31; 'equality': 0.31; 'class': 0.32; 'definition': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'object,': 0.36; 'possible': 0.36; 'two': 0.37; 'level': 0.37; 'pm,': 0.38; 'simple,': 0.60; 'skip:n 10': 0.64; 'more': 0.64; 'ambiguous': 0.84; 'case?': 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=BtoYX6dAv4HXKBOiuO8LiQOvwi9V9qykNPzeN3C2d4w=; b=GR6R/DbJw9e0gpForFjCk8+P0YuuMMaQ+IhKCseqOijF0rL2/GAtIXuiPVZzEk34jH 4t5wzRE6V4BjZ2jTAYh7pjXaSuBwFWc45I9YUhS/cZfomY9FersqHI41n+VSCpvizaTv CKxIwfwOvjy2kVW3OqXTHOcTSLivNFzIOeVS3Ovd6UuFuzD6XKjZGccduMF2XKQ8wRKh BzeLbo5Wbwz/YqXWKwtbIalkwXT5K0lMk1QYOKxbpdOFI3D3JXHaTCoUdKJwHjt2RdmF UgWU92ctdK4x5nPr8SDn+j/jAE2GcxJXQmytLmpCnrHuEqKCrkMDiFgL/9em81XCGy1K oQUw== MIME-Version: 1.0 X-Received: by 10.66.217.133 with SMTP id oy5mr13030665pac.46.1392430119421; Fri, 14 Feb 2014 18:08:39 -0800 (PST) In-Reply-To: <59c876d3-02f5-4f5a-8728-a5098472e03d@googlegroups.com> References: <13208de8-0f85-4e60-b059-dc087c8fda41@googlegroups.com> <917ede6d-db7c-4a8c-8203-27677283776b@googlegroups.com> <871tz5piy0.fsf@elektro.pacujo.net> <87vbwho1i0.fsf@elektro.pacujo.net> <87mwhtnzdu.fsf@elektro.pacujo.net> <59c876d3-02f5-4f5a-8728-a5098472e03d@googlegroups.com> Date: Sat, 15 Feb 2014 13:08:39 +1100 Subject: Re: Explanation of list reference 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392430127 news.xs4all.nl 2862 [2001:888:2000:d::a6]:48201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66346 On Sat, Feb 15, 2014 at 12:55 PM, Rustom Mody wrote: > On Saturday, February 15, 2014 6:27:33 AM UTC+5:30, Chris Angelico wrote: >> Can you give an example of an ambiguous case? Fundamentally, the 'is' >> operator tells you whether its two operands are exactly the same >> object, nothing more and nothing less > > Fundamentally your definition above is circular: In effect > the python expr "a is b" is the same as a is b. It's not circular, it's stating the definition of the operator. And since the definition is so simple, it's impossible - at that level - for it to be ambiguous. It's possible for equality to be ambiguous, if you have two types which define __eq__: class Everyone: def __eq__(self, other): return True class Noone: def __eq__(self, other): return False >>> Everyone()==Noone() True >>> Noone()==Everyone() False But it's not possible for 'is' to behave like that. ChrisA