1# Example of multiple inheritance
2# I recommend to avoid it, because it's too complex to be relyed on.
3
4class Thing(object):
5 def func(self):
6 print("Function ran from class Thing()")
7
8class OtherThing(object):
9 def otherfunc(self):
10 print("Function ran from class OtherThing()")
11
12class NewThing(Thing, OtherThing):
13 pass
14
15some_object = NewThing()
16
17some_object.func()
18some_object.otherfunc()
1class a:
2 def __init__(self):
3 print("Hello")
4
5class c:
6 def __init__(self, text):
7 print(text)
8
9class d(a,c):
10 def__init__(self,text):
11 a.__init__(self)
12 c.__init__(self,text)