Don't Do This
summary
Shows concrete gotchas and toys: that a class bases clause can be an expression used as an exception type, generators can yield exception classes, and function.__code__ swapping lets one function take another’s body. Demonstrates building code objects from XML via ElementTree/ast/compile and a custom importer (one trial provokes a segfault), using inspect.currentframe().f_back.f_locals to inject JSON into a caller, the pip install q runtime inspector, ctypes hacks to make modules callable and ForbiddenFruit’s curse to add methods to builtins. Works, but brittle.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:07Richard Jones
- 1:14Corner Cases of the Python Grammar
- 1:31Serialization
- 5:10Create Code Objects by Hand
- 5:59Abstract Syntax Tree
- 7:07Install the Pi Xml Loader
- 16:19Overloading of Methods
- 20:08Side-Effects
- 21:38How Does Callable Modules Enable Work
- 23:35Define the Structure








