First page Back Continue Last page Overview Graphics

Cooperative Classes

class A(object):

def m(self)

class D(B,C):

class B(A):

class C(A):

def m(self)

The diagramm shows that B and C inherit from A that D inherits from B and C.

Let's assume that a method m() of A is overwritten in C.

m() will not be changed in B.

If we apply the method m() on an instance of the class D, m() of C and not m() of A will be used.