Here is an example model of what I have in my python code
class BasicActivity:
def run(self):
print "basic run"
def jump(self):
print "basic jump"
class ChickenStyleActivity(BasicActivity):
def run(self):
print "run like chicken"
class BunnyStyleActivity(BasicActivity):
def jump(self):
print "jump like bunny"
class ExtraordinaryActivity(ChickenStyleActivity,BunnyStyleActivity):
pass
d = ExtraordinaryActivity()
d.run()
d.jump()
I was expecting to have both chicken and bunny styles in one class, but surprisingly for me it was chicken run but basic jump. I started reading about method resolution order and now I can see that changing order of classes in multiple inheritance will bring the opposite effect.
The question is - how can I have both Chicken and Bunny styles in one class?
More generally: how to properly inherit several classes which have common base class when method overriding comes into play?