I have a class that has an attribute as an object from another class. A third class inherits from the first class, and in there, I want to override the attribute's method ...
class Car:
def __init__(self, door):
self.door = door
class Door:
def __init__(self, color):
self.color = color
def change_color(self):
pass
class CarConstruct(Car):
def __init__(self):
super(CarConstruct, self).__init__(Door('red'))
# Here, I want to override self.door.change_color method
What is the best way to override in such a situation?