python私有方法的使用


class TESTOne:
    def select(self,data):
        return self.__calu(data)
    def __calu(self,data):
        print(data+110)
        return data+110
class TestTwo:
    def update(self,data):
        self.select(data+100)
    def select(self,data):...
    def test(self,data):
        return self.__calu(data)
    def __calu(self,data):
        print(data+120)
        return data+120
class TestThree(TESTOne, TestTwo):
    def __init__(self):
        super().__init__()
if __name__ == "__main__":
    t = TestThree()
    t.update(1)
    t.test(1)

声明:一代明君的小屋|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - python私有方法的使用


欢迎来到我的小屋