You can call the parent method exactly the same way you used for the __init__
one:
class Child(Parent):
def __init__(self):
Parent.__init__(self)
def method_parent(self):
Parent.method_parent(self) # call method on Parent
print "Child"
This one is when you want to explicitely name the parent class. If you prefere, you can ask python to give you next class in Method Resolution Order by using super
:
def method_parent(self):
super(Child, self).method_parent() # call method on Parent
print "Child"