class A(object): def foo(self, a): return a + 1 def bar(self, a, b): return self.foo(a) * self.foo(b) class B(A): def foo(self, a): return a - 1 b=B() print b.bar(5, 9)