#coding:utf-8

class A(object):
    def _test1(self):
        print(\'this is _test1\')
    def test2(self):
        print(\'this is test2\')
    def __test3(self):
        print(\'__test3\')

class B(A):
    def run(self):
        self._test1()
        self.test2()
        self._A__test3()

b = B()
a = A()
a._A__test3()
b.run()

  结果

__test3
this is _test1
this is test2
__test3

  

版权声明:本文为timtike原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/timtike/p/7707965.html