Possible Duplicate:
Get object by id()?
>>> var = 'I need to be accessed by id!'
>>> address = id(var)
>>> print(address)
33003240
Is there any way to use address of var
in memory, provided by id()
, for accessing value of var
?
UPD:
I also want to say, that if this cannot be done in standard Python, it also would be interesting, if this somehow could be implemented via hacking C++ internals of Python.
UPD2:
Also would be interesting to know, how to change value of var
.