To add to that last one. You can actually change manipulate the integer cache using the module ctypes. Do this, if you want to get fired from you job :D
import ctypes def mutate_int(an_int, new_value): ctypes.memmove(id(an_int) + 24, id(new_value) + 24, 8) a_number = 7 another_number = 7 mutate_int(a_number, 13) print(a_number) # 13 print(another_number) # also 13 now
Now we have replaced 7 by 13.
print(7) # 13 print(7+1) # 14 print(7*2) # 26
Source: kate.io/blog/2017/08/22/weird-pyth...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To add to that last one. You can actually change manipulate the integer cache using the module ctypes. Do this, if you want to get fired from you job :D
Now we have replaced 7 by 13.
Source: kate.io/blog/2017/08/22/weird-pyth...