timtike
#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

  

分类:

技术点:

相关文章:

  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-12-24
猜你喜欢
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-08-17
  • 2021-09-25
相关资源
相似解决方案