In the below sample, the last 2 lines in the B.Go()
method both call the Go()
method from class A
. Are they functionally identical? Is the only benefit to using super()
that I don t have to know the inherited class name?
class A(object):
def Go(self):
print "Calling A.Go()"
class B(A):
def Go(self):
super(B, self).Go()
A.Go(self)
inst = B()
inst.Go()