I'm a beginner and this doubt caught me...
I have the class ProfessorAuxiliar
which inherits the attributes of the classes Professor
and Aluno
.
But when using super()
it returns TypeError: __init __ () takes 7 positional arguments but 10 were given
.
...
class Aluno(Pessoa):
def __init__(self, nome, sobrenome, cpf, data, sexo, matricula, semestre, curso):
super().__init__(nome, sobrenome, cpf, data, sexo)
self.__matricula = matricula
self.__semestre = semestre
self.__curso = curso
class Professor(Pessoa):
__lista_de_indicacoes = []
def __init__(self, nome, sobrenome, cpf, data, sexo, materia):
super().__init__(nome, sobrenome, cpf, data, sexo)
self.__materia = materia
class ProfessorAuxiliar(Professor, Aluno):
def __init__(self, nome, sobrenome, cpf, data, sexo, materia, matricula, semestre, curso):
super().__init__(nome, sobrenome, cpf, data, sexo, materia, matricula, semestre, curso)
...
How can I make the ProfessorAuxiliar
class inherit all the attributes of the other 2?