If you have one class using multiple inheritance using two classes with the same name for a function, which function takes priority? From what I found the function coming first in the class declaration takes priority. Is there a better way to call a function from the class listed second than what I have now?
class test():
number = 10
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
self.something = z
def printnumber(self):
print(self.number)
class trial():
def __init__(self,a,b,c):
self.a = a
self.b = b
self.c = c
def printnumber(self):
print(self.c)
class check(test, trial):
def __init__(self, a, b, c,x,y,z):
trial.__init__(self ,a, b, c)
test.__init__(self, x,y,z)
def printnumber(self):
return trial.printnumber(self)
Also, just curious, are there any other times in multiple inheretince or classes in general where the order that you list the classes in the class header matters?