title: How does a super method work in python in case of multiple inheritance?
body: <p>How does a super method actually works in python?</p>
  
  <p>In the given code:</p>
  
  <pre><code>class A(object):
      def test(self):
          return 'A'
  
  
  class B(A):
      def test(self):
          return 'B-&gt;'+super(B, self).test()
  
  
  class C(A):
      def test(self):
          return 'C'
  
  
  class D(B,C):
      pass
  
  
  print B().test()    # B-&gt;A
  print D().test()    # B-&gt;C  ????
  
  # MRO of classes are as
  print 'mro of A', A.__mro__   # [A,object]
  print 'mro of B', B.__mro__   # [B,A,object]
  print 'mro of C', C.__mro__   # [C,A,object]
  print 'mro of D', D.__mro__   # [D,B,C,A,object]
  </code></pre>
  
  <p>when <code>test</code> is called on D, it output <code>B-&gt;C</code> instead of <code>B-&gt;A</code> (which I was expecting).</p>
  
  <p>How is super inside B referring to an instance of C?</p>