Re: overriding equals operation

Discussion in 'Python' started by Dave Angel, Oct 16, 2012.

  1. Dave Angel

    Dave Angel Guest

    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
    Dave Angel, Oct 16, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward A Thompson
    Replies:
    4
    Views:
    525
    Tony Morris
    Feb 11, 2004
  2. david ullua
    Replies:
    13
    Views:
    661
  3. raan
    Replies:
    2
    Views:
    446
  4. Pradipto Banerjee

    overriding equals operation

    Pradipto Banerjee, Oct 16, 2012, in forum: Python
    Replies:
    5
    Views:
    151
    Mark Lawrence
    Oct 17, 2012
  5. Dwight Hutto

    Re: overriding equals operation

    Dwight Hutto, Oct 17, 2012, in forum: Python
    Replies:
    0
    Views:
    167
    Dwight Hutto
    Oct 17, 2012
Loading...

Share This Page