I've read many of the other questions and opinions about super like super-harmful and super-considered-super but none of them mention inspect.getmro as an alternative. I'm wondering, instead of implementing a class hierarchy like this: class Base(object): def __init__(self, **kwargs): print("base init") class A(Base): def __init__(self, **kwargs): super(A, self).__init__() print("a init") class B(Base): def __init__(self, **kwargs): super(B, self).__init__() print("b init") class C(A, B): def __init__(self, **kwargs): super(C, self).__init__() print("c init") Why don't we do something like this? import inspect class Base(object): def __init__(self, **kwargs): mro = inspect.getmro(self.__class__) for mro_cls in reversed(mro): if hasattr(mro_cls, "_init"): mro_cls._init(self, **kwargs) def _init(self, **kwargs): print("base") class A(Bas
A site where you can share knowledge