I have the following code snippet:
class A:
def __init__(self):
self._a = 1
class B:
def __init__(self):
self._b = 2
class C(A, B):
def __init__(self):
super(C, self).__init__()
self._c = 3
c = C()
The resulting object does not have the attribute _b
, and in fact B's __init__()
is never invoked.
I expected both parents' __init__()
methods to be invoked one after the other. Was I mistaken? I couldn't find contradicting info.
(I use python 3.6)