File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ class Parent1 (object ):
2+ def __init__ (self ):
3+ super ().__init__ ()
4+ print ("is Parent1" )
5+ print ("goes Parent1" )
6+
7+ class Parent2 (object ):
8+ def __init__ (self ):
9+ super ().__init__ ()
10+ print ("is Parent2" )
11+ print ("goes Parent2" )
12+
13+ class Child1 (Parent1 ):
14+ def __init__ (self ):
15+ print ("is Child1" )
16+ super ().__init__ ()
17+ #Parent1.__init__(self)
18+ print ("goes Child1" )
19+
20+ class Child2 (Parent1 ):
21+ def __init__ (self ):
22+ print ("is Child2" )
23+ super ().__init__ ()
24+ #Parent1.__init__(self)
25+ print ("goes Child2" )
26+
27+ class Child3 (Parent2 ):
28+ def __init__ (self ):
29+ print ("is Child3" )
30+ super ().__init__ ()
31+ # Parent2.__init__(self)
32+ print ("goes Child3" )
33+
34+ class Grandson (Child1 ,Child2 ,Child3 ):
35+ def __init__ (self ):
36+ print ("is Grandson" )
37+ Child1 .__init__ (self )
38+ Child2 .__init__ (self )
39+ Child3 .__init__ (self )
40+ print ("goes Grandson" )
41+
42+
43+ if __name__ == "__main__" :
44+ Grandson ()
You can’t perform that action at this time.
0 commit comments