Last active
August 29, 2015 14:25
-
-
Save ivandeex/cfabc0da0eb2f964d993 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method 1 | |
import ctypes | |
obj = ctypes.cast(id(orig_obj), ctypes.py_object).value | |
# method 2 | |
import gc | |
for obj in gc.get_objects(): | |
if id(obj) == id_: | |
yield obj | |
else: | |
raise LookupError("No found") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment