Skip to content

Instantly share code, notes, and snippets.

@aliafshar
Last active August 29, 2015 14:02
Show Gist options
  • Save aliafshar/f014055896e02a197ab0 to your computer and use it in GitHub Desktop.
Save aliafshar/f014055896e02a197ab0 to your computer and use it in GitHub Desktop.
where is your god now?
>>> import ctypes
>>> ctypes.c_int.from_address(id(True) + 16).value = 0
>>> True
False
@B-Con
Copy link

B-Con commented Jun 24, 2014

For those who care: This relies on the Python implementation using an object memory address as the object unique ID, so it will work in CPython but may not port to other implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment