#!/usr/bin/env python class A: def imp (self): print "A.imp" def f (self): print "A.f" self.imp () class B(A): def imp (self): print "B.imp" a = A () b = B () a.f () b.f ()