delegation

Why aren't superclass __init__ methods automatically invoked?

Why aren't superclass __init__ methods automatically invoked? Question: Why did the Python designers decide that subclasses’ __init__() methods don’t automatically call the __init__() methods of their superclasses, as in some other languages? Is the Pythonic and recommended idiom really like the following? class Superclass(object): def __init__(self): print ‘Do something’ class Subclass(Superclass): def __init__(self): super(Subclass, self).__init__() …

Total answers: 11