Possible Duplicate:
Python: Get object by id
Typically when you see the string representation of an instance it looks something like <module.space.Class @ 0x108181bc>. I am curious if it’s possible to take this string and get a handle on the instance.
Something like
obj_instance = get_instance_form_repr("<module.space.Class @ 0x1aa031b>")
I don’t believe it could be possible but if it is, it would be really useful.
You can do it for the subset that is tracked by the garbage collector at least, in a nasty and unreliable way.
You can do even more things if you write a simple C extension and inspect the memory address.