First thing to consider: C inherits constructor from B (because it's not defined in C).
Second thing to consider:
self.__class__
in __init__
invocation in C class is C, not B.
Let's analyze:
C().__init__
calls super(self.__class__, self).__init__(v, v2)
which is resolved to
super(C, self).__init__(v, v2)
which means B.__init__(self, v, v2)
.
- First argument passed to
B.__init__
has a type C
. super(self.__class__, self).__init__(v, v2)
is again resolved to B.__init__(self, v, v2)
.
- And again, and again, and again. And there is your infinite recursion.