Removing objects

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Wed Jan 23 16:53:55 EST 2008


On Wed, 23 Jan 2008 10:32:55 -0200, Eduardo O. Padoan wrote:

> On Jan 23, 2008 9:55 AM, Steven D'Aprano
> <steve at remove-this-cybersource.com.au> wrote:
>> For that to work, you need to give your class an __eq__ method, and
>> have it match by name:
>>
>>     # put this in MyClass
>>     def __eq__(self, other):
>>         return self.name == self.other
> 
> Do you mean:
> 
>     # put this in MyClass
>     def __eq__(self, other):
>         return self.name == other.name
> 
> ?


Oops. Yes, thank you.



-- 
Steven



More information about the Python-list mailing list