Before you say to use a dictionary, I want to change the value of the actual variable.
This is what happens with the standard dict strategy: (Note that I'm not necessarily using a list, the value could be a complex class type or just a regular int)
>>> dict = {}
>>> x = [1,2,3]
>>> dict["x"] = x
>>> x
[1, 2, 3]
>>> dict["x"]
[1, 2, 3]
>>> dict["x"] = [4,5,6]
>>> dict["x"]
[4, 5, 6]
>>> x
[1, 2, 3]
>>>
Anyone know a way to do this so that the actual contents of x are changed as well? copy.deepcopy doesn't do the trick either. (as in 'dict["x"] = copy.deepcopy(x)')