python multiple inheritance from different paths with same method name

With the following code sample, can super be used, or C has to call A.foo and B.foo explicitly?

class A(object):
    def foo(self):
        print 'A.foo()'

class B(object):
    def foo(self):
        print 'B.foo()'

class C(A, B):
    def foo(self):
        print 'C.foo()'
        A.foo(self)
        B.foo(self)
23
задан sayap 28 September 2010 в 07:05
поделиться