On Mon, 16 Jan 2006 10:34:40 +0000, Bengt Richter wrote:

>  >>> 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

Why are A().__eq__ and B().__eq__ both being called twice?


-- 
Steven.

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

Reply via email to