python类中前面有双下划线的属性

python中 前面双下划线的属性,会保存到 _ClassName__variable 中。因此这里经过 “_LocalProxy__local” 设置的值,后面能够经过 self.__local 来获取。python In [66]: class A: ...: def __init__(self): ...: self._A__name = 'Abbie
相关文章
相关标签/搜索