It's Pythons All The Way Down: Python Types & Metaclasses Made Simple
summary
Explains how Python implements types and classes, shows type(...) as a class factory to make classes dynamically, demos descriptors with __get__/__set__/__delete__ and the newer __set_name__ on descriptors that often removes the need for metaclasses, and surveys real uses: Django ModelBase registering models and adding per-model exceptions and field names, ABC meta enforcing abstract methods, dynamic mixin-combinations, and class-decorator or codegen alternatives; complexity is real but the patterns shown work and are useful when justified.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:30Welcome
- 2:03Commercial break
- 3:28Overview
- 4:41Python Types
- 9:47Core Types
- 12:27Class Types
- 14:22What is a Class
- 21:07Defining a Class
- 22:38Inheritance
- 31:25Python Methods
- 33:50Questions
- 37:15Type
- 48:15Class attribute lookup
- 54:16Model class
- 55:29Metaclasses in Python
- 57:29Django Metaclasses
related talks
30mThe Wizardry of Metaprogramming
36mPractical Python Design Patterns
33mMetaprogramming in Python
30mMetaclasses Demystified
46mOn Being Pythonic
47mA Deep-Dive Into Python Classes
29mMetaprogramming with Decorators, Metaclasses, and Dynamic Code Generation
32mEasier Classes: Python Classes Without All the Cruft
