First of all if you want to use super function then you have to use base class as object like this
class c(object):
pass
Because super function support in only new style programming of python only.
Now coming to how to access function of base class of base class. In your case how to call my_method function of class C from A.
You can do this in two ways statically and dynamically.
Dynamically
class C(object):
def my_method(self):
print "in function c"
class B(C):
def my_method(self):
print "in function b"
class A(B):
def my_method(self):
# Call my_method from B
super(A, self).my_method()
# This is how you can call my_method from C here ?
super((self.__class__.__bases__)[0], self).my_method()
obj_a = A()
obj_a.my_method()
Here (self.__class__.__bases__
) will return base classes of A in tuple type thats why i took the 0th index. So it return the class B so having B class as a argument in super it will return my_method function of base class of b class.
Statically
class C(object):
def my_method(self):
print "in function c"
class B(C):
def my_method(self):
print "in function b"
class A(B):
def my_method(self):
# Call my_method from B
super(A, self).my_method()
# This is how you can call my_method from C here ?
obj_a = A()
super(A,obj_a).my_method() # calls function of class B
super(B,obj_a).my_method() # calls function of class A