4 ms·
Ok now this truly awful print(1, 2) # prints "2 2" Pointers are bad but this implementation is broken. There is no way to do this using pointers IRL.
by cuteboy19 5y ago
Ok now this truly awful
print(1, 2) # prints "2 2"
Pointers are bad but this implementation is broken. There is no way to do this using pointers IRL.
- lanstin 5y ago1 and 2 are objects in Python. You can change the field corresponding to the int value of the field for the object pointed to by 1. Even worse small ints are cached, so now you have changed 1 for the entire interpreter.
- JonChesterfield 5y agoOne small step towards Fortran
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- omnicognate 5y agoIt's absolutely pure unadulterated evil, deliberately overwriting memory owned by the interpreter in ways that the author knows will result in corruption, bizarre behaviour and crashes. It's also a 13 year old awesomely messing around with cpython internals in their spare time. Bravo!