[lang-ref] ( method_override ) ( python )
def test_method_override():
# just define same method name
class Parent:
def method01(self):
return 'parent method01'
def method02(self):
return 'parent method02'
class Child(Parent):
def method01(self):
return 'child method01'
c = Child()
assert c.method01() == 'child method01'
assert c.method02() == 'parent method02'