Python Data Model
summary
Explains the Python data model and how implementing its special methods (like __init__, __repr__, __len__, __iter__, __getitem__, operator and rich comparison hooks, etc.) lets user-defined classes integrate with core Python behavior. Shows how following the data model makes custom objects behave like built-in types so they become more "pythonic" and unlock their full potential in the language.
AI-written summary · about
chapters (15)
- 0:00Python Data Model
- 1:08What is Data Model
- 2:30Magic methods in Python
- 4:17Ecosystem integration
- 6:49Iteration with magic methods
- 10:46Operator overloading
- 12:51Object representation
- 14:17Object comparison
- 15:46Algebraic operators
- 17:11Boolean context
- 18:34Python Data Classes
- 20:39Properties and attributes
- 22:27Context managers
- 25:14Conclusion and benefits
- 26:20Q&A
related talks
25mThe Magic of Python
47mA Deep-Dive Into Python Classes
26mEverything you need to know but were afraid to ask about Data Classes
01h 18mPython 103: Mmmm... Understanding Python's Memory Model, Mutability, and Methods
27mUnder the Hood Hacking Python Data Types for Fun and Power
30mThe Wizardry of Metaprogramming
01h 10mIt's Pythons All The Way Down: Python Types & Metaclasses Made Simple
01h 18mPython 103: Mmmm... Understanding Python's Memory Model, Mutability, and Methods
