title: Why is __init__() always called after __new__()?
body: <p>I'm just trying to streamline one of my classes and have introduced some functionality in the same style as the <a href="https://en.wikipedia.org/wiki/Flyweight_pattern" rel="noreferrer">flyweight design pattern</a>.</p>
  
  <p>However, I'm a bit confused as to why <code>__init__</code> is always called after <code>__new__</code>. I wasn't expecting this. Can anyone tell me why this is happening and how I can implement this functionality otherwise? (Apart from putting the implementation into the <code>__new__</code> which feels quite hacky.)</p>
  
  <p>Here's an example:</p>
  
  <pre><code>class A(object):
      _dict = dict()
  
      def __new__(cls):
          if 'key' in A._dict:
              print "EXISTS"
              return A._dict['key']
          else:
              print "NEW"
              return super(A, cls).__new__(cls)
  
      def __init__(self):
          print "INIT"
          A._dict['key'] = self
          print ""
  
  a1 = A()
  a2 = A()
  a3 = A()
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>NEW
  INIT
  
  EXISTS
  INIT
  
  EXISTS
  INIT
  </code></pre>
  
  <p>Why?</p>