Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31404 > unrolled thread

Re: overriding equals operation

Started byDave Angel <d@davea.name>
First post2012-10-16 10:09 -0400
Last post2012-10-16 10:09 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: overriding equals operation Dave Angel <d@davea.name> - 2012-10-16 10:09 -0400

#31404 — Re: overriding equals operation

FromDave Angel <d@davea.name>
Date2012-10-16 10:09 -0400
SubjectRe: overriding equals operation
Message-ID<mailman.2279.1350396595.27098.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web