python multiple inheritance, calling base class function
<p>I was just trying something with multiple inheritance in python. I come up with this</p>

<pre><code>class ParentOne:
    def foo(self):
        print("ParentOne foo is called")

class ParentTwo:
    def foo(self):
        print("ParentTwo foo is called")

class Child(ParentOne, ParentTwo):

    # how is this working
    def call_parent_two_foo(self):
        super(ParentOne, self).foo()

    # This does not work
    def call_parent_foo(self):
        super(ParentTwo, self).foo()

    def call_super_foo(self):
        super(Child, self).foo()

    def foo(self):
        print("Child foo is called")


if __name__ == "__main__":
    child = Child()
    child.foo()
    child.call_super_foo()
    child.call_parent_two_foo()

    # child.call_parent_foo() #This gives the below error
    # super(ParentTwo, self).foo()
    # AttributeError: 'super' object has no attribute 'foo'
</code></pre>

<p>and it gives the following output</p>

<pre><code>Child foo is called
ParentOne foo is called
ParentTwo foo is called
</code></pre>

<p>I am getting confused as to how calling of <code>super(ParentOne, self).foo()</code> is evaluated in this case. As per my understanding <code>ParentOne</code> class does not have any idea of the methods and attributes of <code>ParentTwo</code> class. How does super works in case of multiple inheritance</p>