Is there a way to force a condition to be true in Python? I've seen it being done in Haskell before and am wondering if you can do it Python. For example:
>>> 2+2==5
True
Well you just need to set four equal to five.
import ctypes
def deref(addr, typ):
return ctypes.cast(addr, ctypes.POINTER(typ))
deref(id(4), ctypes.c_int)[6] = 5
2 + 2
#>>> 5
2 + 2 == 5
#>>> True
Obviously...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With