I have just read Method Resolution Order by GvR, but I wonder if the following statement holds true(I agree with this) in Python's Super is nifty, but you can't use it. So super()
causes the next method in the MRO to be called? Also noted in this comment.
One big problem with 'super' is that it sounds like it will cause the superclass's copy of the method to be called. This is simply not the case, it causes the next method in the MRO to be called (...)
class A(object):
def __init__(self):
#super(A, self).__init__()
print 'init A'
class B(object):
def __init__(self):
print 'init B'
class C(A, B):
def __init__(self):
super(C, self).__init__()
print 'init C'
c = C()
gives
init A
init C
While
class A(object):
def __init__(self):
super(A, self).__init__()
print 'init A'
class B(object):
def __init__(self):
print 'init B'
class C(A, B):
def __init__(self):
super(C, self).__init__()
print 'init C'
c = C()
gives
init B
init A
init C