class Parent1(object):
def foo(self):
print "P1 foo"
def bar(self):
print "P1 bar"
class Parent2(object):
def foo(self):
print "P2 foo"
def bar(self):
print "P2 bar"
class Child(Parent1, Parent2):
def foo(self):
super(Parent1, self).foo()
def bar(self):
super(Parent2, self).bar()
c = Child()
c.foo()
c.bar()
The intention is to inherit foo() from Parent1 and bar() from Parent2. But c.foo() resulting for parent2 and c.bar() is reulting error. Please point to the problem and provide solution.