On Sat, 24 Nov 2007 12:00:25 +0100, Bjoern Schliessmann wrote:

> Licheng Fang wrote:
>> I mean, all the class instances that equal to each other should be
>> reduced into only one instance, which means for instances of this class
>> there's no difference between a is b and a==b.
> 
> If you only want that if "a == b" is True also "a is b" is True,
> overload the is_ attribute of your class. Personally, I don't see any
> advantage in this.

No advantage? That's for sure. There is no is_ attribute of generic 
classes, and even if there was, it would have no special meaning.

Identity testing can't be overloaded. If it could, it would no longer be 
identity testing.


-- 
Steven.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to