The constructor of a parent class calls a method that the child class overrides.
class Widget:
def __init__(self):
self.parts = []
self.setup()
def setup(self):
self.parts.append("base")
class Button(Widget):
def __init__(self, text):
super().__init__()
self.text = text
def setup(self):
self.parts.append(self.text)
b = Button("OK")
print(b.parts)
What happens when the program runs?