当在子类需要调用父类的方法时,在python2.2之前,直接用类名调用类的方法,即非绑定的类方法,并把自身对象self作参数传进去。
class A(object):
def say(self):
print 'I am A'
class B(A):
def say(self):
print 'I am B'
A.say(self)
b = B()
b.say()
class B(A):
def say(self):
print 'I am B'
super(B,self).say()