In [1]:
%load_ext cython
In [2]:
%%cython
cdef class A:
def __cinit__(self):
print('A.__cinit__() called.')
def __init__(self):
print('A.__init__() called.')
cdef class B(A):
def __init__(self):
super().__init__()
cdef class C(A):
def __init__(self):
super().__init__()
In [3]:
b = B()
In [4]:
# 😭 Some user avoids super and called the constructors directly.
class D(B, C):
def __init__(self):
B.__init__(self)
C.__init__(self)
In [5]:
d = D()
In [6]:
# 😭 Some user avoids calling super entirely
class E(B, C):
def __init__(self):
print("I'm super enough already 😇")
In [7]:
e = E()
In [ ]: