init example with super
This commit is contained in:
parent
a72f7124b4
commit
fc0fd91a6c
1 changed files with 14 additions and 0 deletions
14
python-temel/init.example.2.py
Normal file
14
python-temel/init.example.2.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
class A:
|
||||
def __init__(self):
|
||||
print('A.__init__')
|
||||
|
||||
class B:
|
||||
def __init__(self):
|
||||
print('B.__init__')
|
||||
|
||||
class C(A, B):
|
||||
def __init__(self):
|
||||
super(C, self).__init__()
|
||||
print('C.__init__')
|
||||
|
||||
c = C()
|
Loading…
Reference in a new issue