Python inheritance: Skipping super().__init__ loses parent attributes

Python inheritance: Skipping super().__init__ loses parent attributes

Didn’t call super() __init__ in your Python class? Attributes normally set on the parent won’t be on the child!

class Child(Parent):
    def __init__(self, a, b, c):
        self.c = c  # Child sets c
c = Child(10, 20, 30)
print(vars(c))  # {'c':30}
print(c.a)      # error!