class A(object):
def __init__(self):
print('A.__init__()')
class D(A):
def __init__(self):
super(A, self).__init__()
print('D.__init__()')
D()
The output is:
D.__init__()
This is unexpected to me. According to my understanding, super(A, self).__init__()
should have called A
's ctor, thus should have printed "A.init()".
I have read a few other questions about super()
but I don't think they answer my question exactly.
My python is 3.5.3.