标签:调用 ini att int 类的继承 ict init pytho print
class Person(): def __init__(self, name): self.name = name def setName(self, name): self.name = name class Satter(Person): def __init__(self, name, company):
# 调用父类方法 super(Satter, self).__init__(name) self.company = company def setCompany(self, company): self.company = company if __name__ == "__main__": s = Satter("zhao", "byte") print(s.__dict__) s.setName("hahah") print(s.__dict__)
标签:调用 ini att int 类的继承 ict init pytho print
原文地址:https://www.cnblogs.com/zhaoxianxin/p/13295659.html