您好,欢迎来到华拓网。
搜索
您的当前位置:首页name mangling

name mangling

来源:华拓网
[root@shuffle-dev py_test]$ vim sf_namemangling.py 
 17 class C(A):
 18     def __init__(self):
 19         self.__private()
 20         self.public()
 21     @classmethod
 22     def __private(cls):
 23         print 'C.private'
 24     @staticmethod
 25     def public():
 26         print 'public'
 27 
 28 print '---create b---'
 29 b=B()
 30 print '---create c---'
 31 c=C()
 32 print '---method of class C---'
 33 C._C__private()                                                                                          
 34 C.public()
[root@shuffle-dev py_test]$ ./sf_namemangling.py 
---create b---
A.private()
B.public
---create c---
C.private
public
---method of class C---
C.private
public

Copyright © 2019- huatuo3.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务