First page Back Continue Last page Overview Graphics

Example, Continuation

The method m() in C of the previous example overrides the method m() of A. In most cases we want an extension, i.e. first m() of A should be executed and afterwards m() of C.

class C(A):

def m(self):

A.m(self)

print("m in C")

The output of c.m() returns now the following lines:

m in A

m in C