Skip to content

Instantly share code, notes, and snippets.

@DavidBuchanan314
Created January 20, 2025 14:52
Show Gist options
  • Save DavidBuchanan314/6135e77ead1c8730fb535da54bb19435 to your computer and use it in GitHub Desktop.
Save DavidBuchanan314/6135e77ead1c8730fb535da54bb19435 to your computer and use it in GitHub Desktop.
import unsafe # https://github.com/DavidBuchanan314/unsafe-python
mem = unsafe.getmem()
def very_equal(a: int, b: int) -> None:
addr = id(a)
mem[addr+24:addr+32] = b.to_bytes(8, "little")
very_equal(2 + 2, 5)
print(2 + 2 == 5) # True
print(2 + 2) # 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment