3 ms·
Until you start playing with ctypes, where you can change the values of constants. In Python 3: >>> import ctypes >>> ctypes.memmove(id(5)+24, id(23)+24,
by chias 9y ago
Until you start playing with ctypes, where you can change the values of constants.
In Python 3:
>>> import ctypes
>>> ctypes.memmove(id(5)+24, id(23)+24, 8)
>>> 2
2
>>> 3
3
>>> 2 + 3
23
Or, similarly for Python 2
>>> import ctypes
>>> ctypes.cast(id(4),ctypes.POINTER(ctypes.c_int))[4]=5
>>> 2
2
>>> 2 + 2
5