How to inherit the multiple inheritance constructor from a secondary super-class in python3?
Greetings I have a question, how can I make the sub-class: "MyClass" inherit the constructor of the super-class "MySuperClase2" in multiple inheritance?
Code | Python3:
class MiSuperClase1():
def __init__(self):
self.a = "a"
self.b = "b"
def metodo_1(self):
print("metodo_1 metodo llamado")
class MiSuperClase2():
def __init__(self):
self.c = "c"
self.d = "d"
def metodo_2(self):
print("metodo_2 metodo llamado")
class MiClase(MiSuperClase1, MiSuperClase2):
def __init__(self):
super().__init__()
def metodo_3(self):
print("metodo_3 metodo llamado")
#print(self.c, self.d)
c = MiClase()
c.metodo_3()
Doubts:
I have some doubts, thank you for answering them:
How is the super class "MySuperClase2" correctly named when it is the parent class of "MyClass" but it is secondary (so to speak)?
is called: super-class 2, super-secondary class? (I do not understand if ...)
Thank you in advance for your answers !!