I would like to modify an object private variable
class Example():
__myTest1 = 1
__myTest2 = 1
def __init__(self):
pass
def modifyTest(self, name = 'Test1', value):
setattr(self, '__my'+name, value);
I tried the code above and it's seems that not possible to reach a private variable,
AttributeError: Example instance has no attribute '__myTest1'
Is there any way to modify a private variable?