简单地解释overwrite
class Dog(object):
def __init__(self, name):
self.name = name
def run(self):
print("Dog is running")
class WhiteDog(Dog):
def __init__(self, name):
self.name = name
def run(self):
print("white dog is running")
dog = Dog("a")
dog2 = WhiteDog("b")
dog.run()
dog2.run()