I have a Python list, r[]
, and would like to define references, or aliases to specific members of the list. This is easy to do in languages with pointers (like C or C++), but I don't see how to do this in Python.
Specifically, I'd like do something like this:
r[0] = 1
ac <=addressof> r[0]
ac = 2
Now if I evaluate r[0]
I need it to be 2
Is there a way to define such a reference in Python?