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)