class Person(object):
def __init__(self, height):
self.height = height
def show_height(self):
return self.height
class Girl(Person):
def __init__(self, height, breast):
super(Man, self).__init__(height)
self.breast = breast
p = Person(170)
Girl.show_height(p)
TypeError: unbound method show_height() must be called with Man instance as first argument (got Person instance instead)
错误很清晰,但是不太明白为什么不能这样调用,反过来却可以。