Почему не вызывается конструктор базового класса?
Не могу понять, почему не вызывается конструктор базового клсса через функцию super(). Интерпритатор выдает вот такую ошбку
TypeError: descriptor 'init' requires a 'super' object but received a 'type'
class CarBase:
def __init__(self, brand, photo_file_name, carrying):
self.brand = brand
self.photo_file_name = photo_file_name
self.carrying = carrying
self.car_type = None
def get_photo_file_ext(self):
return os.path.splitext(self.photo_file_name)[1]
class Car(CarBase):
def __init__(self, brand, photo_file_name, carrying, passenger_seats_count):
super.__init__(brand, photo_file_name, carrying)
self.passenger_seats_count = passenger_seats_count
self.car_type = "car"
class Truck(CarBase):
def __init__(self, brand, photo_file_name, carrying, body_whl):
super.__init__(brand, photo_file_name, carrying)
self.car_type = "truck"
self.body_height = self.body_length = self.body_width = 0
body_characteristic_list = body_whl.split('x')
if len(body_characteristic_list) == 3:
if "".join(body_characteristic_list).isdigit == True:
self.body_length = float(body_characteristic_list[0])
self.body_width = float(body_characteristic_list[1])
self.body_height = float(body_characteristic_list[2])
def get_body_volume(self):
return self.body_height * self.body_length * self.body_width
class SpecMachine(CarBase):
def __init__(self, brand, photo_file_name, carrying, extra):
super.__init__(brand, photo_file_name, carrying)
self.extra = extra
self.car_type = spec_machine