When an instance of a class is initialized, the super-class state should be fully initialized before it becomes visible to the subclass. Calling methods of the subclass in the superclass' __init__ method violates this important invariant.

Do not use methods that are subclassed in the construction of an object. For simpler cases move the initialization into the superclass' __init__ method, preventing it being overridden. Additional initialization of subclass should be done in the __init__ method of the subclass. For more complex cases, it is advisable to use a static method or function to manage object creation.

Alternatively, avoid inheritance altogether using composition instead.

  • CERT Secure Coding: Rule MET05-J. Although this is a Java rule it applies to most object-oriented languages.
  • Python Standard Library: Static methods.
  • Wikipedia: Composition over inheritance.