有代码:
class A:
@staticmethod
def g():
A.__z = 4
print(dir(A))
A.g()
print(dir(A)) # A has attribute _A__z
A.__m = 5
print(dir(A)) # A has attribute _A__z and __m
为什么名称__m不被改成_A__m而是__z呢?
ABOUTYOU
12345678_0001
相关分类