Skip to content

Instantly share code, notes, and snippets.

@timo-boehm
Last active June 13, 2020 08:51
Show Gist options
  • Save timo-boehm/73efdfb451669748e626837b94ba7963 to your computer and use it in GitHub Desktop.
Save timo-boehm/73efdfb451669748e626837b94ba7963 to your computer and use it in GitHub Desktop.
import ctypes
def scores(name, score, records = dict()):
records[name] = "passed" if score > 60 else "failed"
return records, id(records)
_, address1 = scores("Timo", 55)
_, address2 = scores("Andy", 80)
print(address1 == address2) # True
print(ctypes.cast(address1, ctypes.py_object).value) # {'Timo': 'failed', 'Andy': 'passed'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment