<s>[INST] Python: Get object by id Let's say I have an id of a Python object, which I retrieved by doing id(thing). How do I find thing again by the id number I was given?
 [/INST] This can be done easily by ctypes:
import ctypes
a = "hello world"
print ctypes.cast(id(a), ctypes.py_object).value

output:
hello world

 </s>