_ClassName__privt
class ClassName:
    __privt = 50  # 私有变量
a = ClassName()
# 私有变量外界无法访问
print(a.__privt)  # AttributeError: 'ClassName' object has no attribute '__privt'
print(a._ClassName__privt)  # 50 强制访问私有变量(加前缀 _ClassName )
print(CounterList.__mro__)
(<class '__main__.CounterList'>, <class 'list'>, <class 'object'>)
                    
                
                
            
        
浙公网安备 33010602011771号