forked from floft/codats
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiple_inheritance_check.py
More file actions
executable file
·48 lines (34 loc) · 969 Bytes
/
multiple_inheritance_check.py
File metadata and controls
executable file
·48 lines (34 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
"""
Test heterogeneous multiple inheritance
"""
class MethodBase:
def __init__(self):
print("MethodBase")
class MethodDann(MethodBase):
def __init__(self):
super().__init__()
print("MethodDann")
class MethodDaws(MethodBase):
def __init__(self):
super().__init__()
print("MethodDaws")
class HeterogeneousBase:
def __init__(self):
super().__init__()
print("HeterogeneousBase")
class HeterogeneousDann(HeterogeneousBase, MethodDann):
pass
# def __init__(self):
# super().__init__()
# print("HeterogeneousDann")
# print(HeterogeneousDann.__mro__)
class HeterogeneousDaws(HeterogeneousBase, MethodDaws):
pass
# def __init__(self):
# super().__init__()
# print("HeterogeneousDaws")
# print(HeterogeneousDaws.__mro__)
if __name__ == "__main__":
a = HeterogeneousDann()
# b = HeterogeneousDaws()