从父类继承过程中,super()能不能不从父类全部继承
# Enter a code class Person(object): def __init__(self,name,gender): self.name = name self.gender = gender class SkillMixin(object): def __init__(self,skill): self.skill = skill class Student(Person): def __init__(self,name,gender,score): super(Student,self).__init__(name,gender) self.score = score class Tercher(Person): def __init__(self,name,gender,course): super(Tercher,self).__init__(name,gender) self.course = course class BasketballMixin(SkillMixin): def skill(self): return 'Skill is basketball' class FootballMixin(SkillMixin): def skill(self): return 'Skill is football' class BStudent(Student,BasketballMixin): def __init__(self,name,gender,score = 0): super(BStudent,self).__init__(name,gender,score) class FTercher(Tercher,FootballMixin): def __init__(self,name,gender,course = ' '): super(FTercher,self).__init__(name,gender,course) s = BStudent('Bob','Male') print('Studen\'s name is {}, Gender is {}, Skill is {}.'.format(s.name, s.gender ,s.skill())) t = FTercher('Alice','Female') print('Tercher\'s name is {}, Gender is {}, Skill is {}.'.format(t.name, t.gender ,t.skill()))
Line27和Line30,super()能不能不继承父类的全部参数?