in python everything works by reference:
>>> a = 1
>>> d = {'a':a}
>>> d['a']
1
>>> a = 2
>>> d['a']
1
i want something like this
>>> a = 1
>>> d = {'a':magical pointer to a}
>>> d['a']
1
>>> a = 2
>>> d['a']
2
what would you substitute for 'magical pointer to a' so that python would output what i want
i would appreciate general solutions (not just for the above dictionary example with independent variables, but something that would work for other collections and class/instance variables)