# class Oldboypeople:
# school = ' Oldboy '
# def __init__ (self,name,age,sex):
# Self.name=name
# Self.age=age
# Self.sex=sex
#
# Def eat (self):
# print (' is eating ')
# def teach (self):
# print (' This is teach of the parent class ')
#
# class Oldboyteacher (oldboypeople):
# def __init__ (self,name,age,sex,salary,title):
# # oldboypeople.__init__ (self,name,age,sex)
# #在Python2中需要写全: Super (Oldboyteacher,self)
# super (). __init__ (Name,age,sex)
# self.salary=salary
# Self.title=title
#
# def teach (self):
# # Oldboypeople.teach (self)
# super (). Teach ()
# print ('%s is teaching '%self.name)
# Print (OLDBOYTEACHER.MRO ())
#
# egon_obj=oldboyteacher (' Egon ', ' Male ', 3.1, ' Shahe overbearing Gold lecturer ')
# # print (egon_obj.title)
# # print (egon_obj.__dict__)
# Egon_obj.teach ()
Class A:
def test (self):
Super (). Test ()
Class B:
def test (self):
Print (' B ')
Class C (A, B):
Pass
# a=a ()
# a.test ()
Print (C.MRO ())
C=c ()
C.test ()
Python__ method for calling the parent class of a subclass