title: How to perform common post-initialization tasks in inherited classes?
body: <p>The initialization process of a group of classes that share a common parent can be divided into three parts:</p>
  
  <ul>
  <li>Common initialization</li>
  <li>Subclass-specific initialization</li>
  <li>Common post-initialization</li>
  </ul>
  
  <p>Currently the first two parts are called from the <code>__init__</code> method of each child class, but the final post-initialization part has to be called separately, for example</p>
  
  <pre><code>class BaseClass:
      def __init__(self):
          print 'base __init__'
          self.common1()
  
      def common1(self):
          print 'common 1'
  
      def finalizeInitialization(self):
          print 'finalizeInitialization [common2]'
  
  
  class Subclass1(BaseClass):
      def __init__(self):
          BaseClass.__init__(self)
          self.specific()
  
      def specific(self):
          print 'specific'
  
  
  if __name__ == '__main__':
      s = Subclass1()  # Don't forget to finalize the initialization
      s.finalizeInitialization()  # now the object is fully initialized
  </code></pre>
  
  <p>Is there a way to not to have to call <code>finalizeInitialization()</code>? Or one can transfer the call to <code>finalizeInitialization()</code> into <code>Subclass1</code>'s <code>__init__</code> (as in <a href="https://stackoverflow.com/questions/795190/how-to-perform-common-post-initialization-tasks-in-inherited-python-classes/795213#795213">S.Lott's answer</a>). This makes the life easier, but still one has to remember to complete the initialization, this time inside the "constructor". Either way there is no way to enforce full initialization, which is what I'm looking for.</p>