-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEXPR6.py
More file actions
61 lines (43 loc) · 1.45 KB
/
EXPR6.py
File metadata and controls
61 lines (43 loc) · 1.45 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
class Grandmother:
def __init__(self,*args):
self.args = args
class Grandfather:
def __init__(self,*args):
self.args = args
class Mother:
def __init__(self,*args):
self.args = args
class Father:
def __init__(self,*args):
self.args = args
class Daughter:
def __init__(self,*args):
self.args = args
class Son:
def __init__(self,*args):
self.args = args
class Class_all(Grandmother):
print('MRO = "Method Resolution Order"\n')
lazy_0 = (Grandmother('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
lazy_1 = (Grandfather('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
lazy_2 = (Mother('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
lazy_3 = (Father('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
lazy_4 = (Daughter('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
lazy_5 = (Son('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
lazy_6 = (Class_all('Argument Vaue 0','Argument Vaue 1','Argument Vaue 2'))
try:
print(lazy_0.args[0])
except (NameError,IndexError,TypeError):
print('Name or Index Not Found:')
'''
class Grandmother:
def __init__(self, *args):
print("Inside Grandmother")
self.args = args
class Grandfather:
def __init__(self, *args):
super().__init__(*args) # Passes arguments to the next class in MRO
print("Inside Grandfather")
print(All.mro())
print(All.__mro__)
'''