On 15 Jan 2006 13:50:14 -0800, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
>Mike Meyer <[EMAIL PROTECTED]> writes: >> > I'd say a==b doesn't necessarily mean a and b have the same value. >> Care to say what it does mean (as opposed to what it doesn't mean), then? > >a==b simply means that a.__eq__(b) returns True. That's one possibility, but I guess __eq__ might not necessarily even have to be defined (too lazy to set up the new-style class test ;-): >>> class A: ... def __getattr__(self, attr): print 'A().%s'%attr; raise AttributeError ... >>> class B: ... def __getattr__(self, attr): print 'B().%s'%attr; raise AttributeError ... >>> A()==B() A().__eq__ B().__eq__ B().__eq__ A().__eq__ A().__coerce__ B().__coerce__ A().__cmp__ B().__cmp__ False Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list