"A Confession of My Python Sins"
summary
Thirty percent of a catalog of real hacks: operator overloading used for pathlike and dictset APIs, decorators that turn functions into registration or component factories for Pulumi-style components, dynamic classes and class keyword args plus __init_subclass__ for protocol message registration, custom property descriptors and bound/unbound event descriptors, weakref‑backed sidecar object storage, and import hooks that parse .gql files into Python by AST generation and module import machinery; examples compile, run, and improve developer ergonomics while often breaking static typing and tooling expectations.
AI-written summary · about
chapters (12)
- 0:00Python sins introduction
- 3:14Operator abuse and special methods
- 6:05Dynamic classes and decorators
- 7:09Everything is an object
- 9:17Class subass and registration tricks
- 10:22Class keywords and quirks
- 12:10Property descriptors and DI
- 15:27Typing challenges
- 16:36Q&A
- 17:19Custom GraphQL importers
- 19:48Weak references and sidecar data
- 21:11Python typing opinions








