class Test1(object): def __init__(self,ids): self.ids=idsclass Par(Test1): def __init__(self,ids,user): super().__init__(ids) #Test1.__init__(self,ids) 等价写法 self.user=userif __name__ == '__main__': A=Par("IS IDS","IS USER") print(A.ids,A.user)
来源:https://www.cnblogs.com/SunshineKimi/p/11906910.html