How Python inserts 'self' into methods
summary
Explains how Python binds the instance as the first argument to methods by unpacking the descriptor protocol inside the Python data model. Covers descriptors and how they let you customize attribute access, assignment, and deletion so you can reproduce or alter the behavior that inserts the ordinary ‘self’ parameter.
AI-written summary · about
related talks
25mThe magic of "self": How Python inserts "self" into methods.
26mThe Magic of Self How Python inserts self into methods
26mThe Magic of Self: How Python Inserts self Into Methods
47mA Deep-Dive Into Python Classes
45mDescriptors made easy
38mUnderstanding attributes (Or: They're not nearly as boring as you think!)
31mLife Under the A Guide to Python's Internal Conventions
30mThe Wizardry of Metaprogramming