class Test:
__x = 1
class C:
def test(self):
print(Test.__x)
c = C()
a = Test()
a.c.test()
I get Error Information like this
AttributeError: type object 'Test' has no attribute '_C__x'
So, is it inner class cannot get access to outer class? Or It can be using some other techniques?
And this questions comes from reading Learning Python, when author write about CardHolder, a inner class as a descriptor use instance.__name to reach the outer class' attribute, so what is the rule of whether can we access __X attribute?
Thank you for reading my problem.