mixing super and classic calls in Python
<p>firstly, let me quote a bit an essay from "Expert Python Programming" book:</p>

<blockquote>
  <p>In the following example, a C class that calls its base classes using the _<em>init</em>_ method will
  make B class be called twice!</p>
</blockquote>

<pre><code>class A(object):
    def __init__(self):
        print "A"
        super(A, self).__init__()

class B(object):
    def __init__(self):
        print "B"
        super(B, self).__init__()

class C(A,B):
    def __init__(self):
        print "C"
        A.__init__(self)
        B.__init__(self)

print "MRO:", [x.__name__ for x in C.__mro__]  #prints MRO: ['C', 'A', 'B', 'object']
C()  #prints C A B B
</code></pre>

<p>and finally, here is an explanation of what's going on here:</p>

<blockquote>
  <p><strong>This happens due to the A._<em>init</em>_(self) call, which is made with the C instance,
  thus making super(A, self)._<em>init</em>_() call B's constructor.</strong> In other words,
  super should be used into the whole class hierarchy. The problem is that sometimes
  a part of this hierarchy is located in third-party code.</p>
</blockquote>

<p>i have no idea why "<code>super(A, self).__init__()</code> calls B's constructor". Please explain this moment. Thanks a lot.</p>
