Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'operator': 0.03; 'class,': 0.07; '"a"': 0.09; 'hooks': 0.09; 'cc:addr:python-list': 0.10; 'wrote:': 0.17; 'instance': 0.17; 'pfxlen:0': 0.17; 'define': 0.20; 'trying': 0.21; 'cc:2**0': 0.23; 'statement': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'am,': 0.27; 'right.': 0.27; 'point': 0.31; "can't": 0.34; 'there': 0.35; 'but': 0.36; 'method': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'instead': 0.39; 'received:192': 0.39; 'called': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'equals': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72 Date: Tue, 16 Oct 2012 10:09:21 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Pradipto Banerjee Subject: Re: overriding equals operation References: <76D03718A3233B4C8CC236C169B535B5A23DFDFB43@AUSP01VMBX08.collaborationhost.net> In-Reply-To: <76D03718A3233B4C8CC236C169B535B5A23DFDFB43@AUSP01VMBX08.collaborationhost.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:cc2NJHjQHbhTqSuy8g8Ff8qK2uSnRcUFtGBrizMW5r0 I97K+AjWx/mS6w/RDNHwoP4NOMUyinb858y+ydZSSOpA+UYFqU rxO3HJ8UhGC9ew+HCDfdj6+WMxVZm8LKb/SaQpjQHCUpoLtDMh ScW7dxG7QXt++iYQhsqBZNaQMVX4MpTWSTO8WlZACh+4pJCSh8 4/oJ6mQO0ygzE4M4BbIRoKPgX5YcqBRcuTl55PlWYGAgjylX6+ WP9mpwkvrbQ+cAvxlTR8PD/qJSD6V4yGMrmJwGCguHnmtOM5FL V87HqLPZSe6FJaTeCmYRSvzuS9kbH7IXr5ncaeIAEtTNs/KXw= = Cc: "Python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350396595 news.xs4all.nl 6852 [2001:888:2000:d::a6]:53783 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31404 On 10/16/2012 09:51 AM, Pradipto Banerjee wrote: > I am trying to define class, where if I use a statement a = b, then instead of "a" pointing to the same instance as "b", it should point to a copy of "b", but I can't get it right. > > The __eq__ method is called for equals comparison, like if myinst == otherobj: There are no hooks for the binding operator (=) -- DaveA