Python is Weird
summary
Walks through the actual pipeline: tokenizing → parsing → AST → bytecode, then disassembles examples so you see which opcodes run. Demonstrates surprising valid constructs like ++4; and 0jif.1else-2 that exploit tokenizer rules, shows yield usable inside odd expression contexts and as defaults, proves modules/classes/instances are dictionaries by reading/writing sys.modules and using builtins._class to build a class from a function, and points out which behaviors are parser quirks versus bytecode artifacts.
AI-written summary · about
chapters (11)
- 0:00Introduction to Python weirdness
- 2:20Reassigning True to False
- 3:04How Python tokenizes code
- 7:10Parsing Python into syntax trees
- 11:13Abusing Python grammar quirks
- 14:45CPython implementation insights
- 15:49Python bytecode generation
- 18:04Dictionaries and Python internals
- 20:17Turning functions into classes
- 23:39Closing and contact info
- 24:44Q&A session
