wheatdough py from pizza import pizzadoughfactory class wheatdoughfactory(doughfactory)def get_dough(self)return("wheat floor dough"class wheatpizza(pizzawheatdoughfactory)pass if __name__ ='__main__'wheatpizza(order_pizza('sausage''mushroom'notein pythoninheritance chain is not determine by the parent classbut by the child class if we run the wheatdough pyit will call the super command in class pizza in pizza py will not call his parent class doughfactorybut the parent class of the child class wheatdoughfactory this is called dependency injection importantsuper consider the children before parents it looks methods in child class firstthen it goes for parent class nextit calls the parents in the order of inheritance use keyword arguments for cooperative inheritance for above reasonssuper is super commandas it allows to change the order of inheritance just by modifying the child classas shown in above example notefor better understanding of the super commandsome more short examples are added hereinherit __init__ in the following codeclass rectarea is inheriting the __init__ function of class rectlen in the other wordlength is set by class rectlen and width is set by class rectarea and finally area is calculated by class rectarea rectangle py class rectlen(object)def __init__(selflength)self length length class rectarea(rectlen)def __init__(selflengthwidth)self width width super(__init__(lengthprint("area "self length self widthrectarea( area inheritance with super