title: The call order of python3 metaclass
body: <p>I am in confusion when trying to understand the order that <code>metaclass</code> creates a class instance. According to this <strong>diagram</strong> (<a href="https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#id28" rel="noreferrer">source</a>), <a href="https://i.stack.imgur.com/Ex3jx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ex3jx.png" alt="enter image description here"></a></p>
  
  <p>I type the following <strong>codes</strong> to verify it.</p>
  
  <pre><code>class Meta(type):
      def __call__(self):
          print("Meta __call__")
          super(Meta, self).__call__()
  
      def __new__(mcs, name, bases, attrs, **kwargs):
          print("Meta __new__")
          return super().__new__(mcs, name, bases, kwargs)
  
      def __prepare__(msc, name, **kwargs):
          print("Meta __prepare__")
          return {}
  
  class SubMeta(Meta):
      def __call__(self):
          print("SubMeta __call__!")
          super().__call__()
  
      def __new__(mcs, name, bases, attrs, **kwargs):
          print("SubMeta __new__")
          return super().__new__(mcs, name, bases, kwargs)
  
      def __prepare__(msc, name, **kwargs):
          print("SubMeta __prepare__")
          return Meta.__prepare__(name, kwargs)
  
  class B(metaclass = SubMeta):
      pass
  
  b = B()
  </code></pre>
  
  <p>However, the result seems not like this follow.</p>
  
  <pre><code>SubMeta __prepare__
  Meta __prepare__
  SubMeta __new__
  Meta __new__
  SubMeta __call__!
  Meta __call__
  </code></pre>
  
  <p>Any help will be appreciated.</p>