class Animal(object):
def eat(self):
print("I eat all")
class C(object):
def eat(self):
print("I too eat")
class Wolf(C, Animal):
def eat(self):
print("I am Non Veg")
super(Wolf, self).eat()
Animal.eat(self)
w = Wolf()
w.eat()
I am learning multiple inheritance in python, I want to access Animal
and C
method eat
from derived class using super
method.
Default call of super
inside calls C
class method eat
, but to call Animal
class method I used Animal.eat(self)
.My question is how can I call Animal
class method using super
method.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…