OOP - Is this right or is it a bug ?

Erik Max Francis max at alcyone.com
Tue May 20 03:29:33 EDT 2003


Rony wrote:

> Class C(A,B):
>    def other(self):
>       nop

(Obviously, this is made-up code; it contains syntax errors.)

> You get 'in A'
> 
> I tought you would get 'in B' since you first heritate from A and the
> from B

It does a search for the first base class which has the method.  Since A
is listed first, it finds A's method first and stops looking at that
point.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Everyone wants to look good at his own funeral.
\__/  Louis Wu




More information about the Python-list mailing list