Possible Duplicate:
Python: Get object by id
I have a query, that is, in python if we try this
>>>a=5
>>>id(a)
>>>746363
that is we are getting id , it is equivalent to the address , my query is that ,there is any way to get the value or object from the id , just like we are getting the id from the object
just like as follows,
>>>object(746363)
>>>5
I wrote The above one to deliver my query clearly
idis, of course, an address in the virtual address space of the process, which has nothing to do with the actual physical address in ram (which btw can change due to paging etc. without the process noticing). Even if you had the actual physical address and locked the page in memory so it wouldn't swap, you couldn't access it from userspace code, only the Kernel could.