Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'reason,': 0.07; 'false,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:184.172': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'empty,': 0.16; 'empty.': 0.16; 'tuple': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'skip:l 30': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'said,': 0.30; 'invoke': 0.31; 'quite': 0.32; 'equal': 0.35; 'but': 0.35; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:173': 0.61; 'first': 0.61; 'skip:n 10': 0.64; 'skip:r 30': 0.69; 'car': 0.72; 'received:64.5': 0.84; 'sorry.': 0.91; 'why?': 0.91 Date: Wed, 07 Aug 2013 10:50:12 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Bug? ( () == [] ) != ( ().__eq__([]) ) References: <51FED74E.6080003@markusrother.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:48985 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 2 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375897815 news.xs4all.nl 16010 [2001:888:2000:d::a6]:39601 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52143 On 08/07/2013 02:24 AM, Shiyao Ma wrote: > > Sorry. I don't quite get it. As you said, it first tries, leftOperand.__eq__(rightOperand) then if it returns > NotImplemented, it goes to invoke rightOperand.__eq__(leftOperand). But for any reason, [] == () returns false, why? A list that is empty is not equal to a tuple that is empty, much like a car that is empty is not equal to a boat that is empty. -- ~Ethan~