12 ms·
Things like the Carlo Verre hack (also a thing you can't change —any more— in Python: builtins), editing objects during their construction (via e.g. gc)... gene
by dom0 9y ago
Things like the Carlo Verre hack (also a thing you can't change —any more— in Python: builtins), editing objects during their construction (via e.g. gc)... generally, the gc module allows other ways as well to crash your interpreter.
>>> import gc
>>> 'foo'.lower()
>>> gc.get_referents(str.__dict__)[0]['lower'] = str.upper
>>> 'foo'.lower()
segmentation fault (core dumped) python
(That's the method lookup cache)
A talk in this direction is https://www.youtube.com/watch?v=qCGofLIzX6g https://www.youtube.com/watch?v=qCGofLIzX6g