in multiple inheritance how super() works? for example here I have Two init and I want to send args by super():
class LivingThings(object):
def __init__(self, age ,name):
self.name=name
self.age=age
def Print(self):
print('age: ', self.age)
print('name: ', self.name)
class Shape(object):
def __init__(self, shape):
self.shape=shape
def Print(self):
print(self.shape)
class Dog(LivingThings, Shape):
def __init__(self, breed, age , name, shape):
self.breed=breed
super().__init__(age , name)
super().__init__(shape)
def Print(self):
LivingThings.Print(self)
Shape.Print(self)
print('breed', self.breed)
but error :
super().__init__(shape)
TypeError: __init__() missing 1 required positional argument: 'name'
but this code works :
class Dog(LivingThings, Shape):
def __init__(self, breed, age , name, shape):
self.breed=breed
Shape.__init__(self, shape)
LivingThings.__init__(self,age ,name)
so super() dosent work in multiple inheritance??