将任务的代码改了一下,发现不是想要的结果
class Person(object):
def __init__(self):
print 'person'
class Student(Person):
def __init__(self):
super(Student,self).__init__()
print 'student'
class Teacher(Person):
def __init__(self):
super(Teacher,self).__init__()
print 'teacher'
class SkillMixin(object):
def __init__(self):
print 'skill'
class BasketballMixin(SkillMixin):
def __init__(self):
super(BasketballMixin,self).__init__()
print 'basketball'
def skill(self):
return 'basketball'
class FootballMixin(SkillMixin):
def __init__(self):
super(FootballMixin,self).__init__()
print 'football'
def skill(self):
return 'football'
class BStudent(BasketballMixin,Student):
def __init__(self):
super(BStudent,self).__init__()
class FTeacher(FootballMixin,Teacher):
def __init__(self):
super(FTeacher,self).__init__()
s = BStudent()
为什么不是person student skill basketball