Hi! This is part 7 of my Python behind the scenes series. Each part of the series covers how some aspect of the language is implemented in the interpreter, CPython. This time we'll study how Python attributes work. You'll learn:<p><pre><code> - What CPython does to execute statements like value = obj.attr and obj.attr = value.
- Why attributes of different objects work differently.
- How attributes of most objects work.
- How the __getattribute__(), __getattr__(), __setattr__() and __delattr__() special methods customize attribute access, assignment and deletion.
- How built-in types get their attributes, e.g. __dict__, __dir__(), __base__. What these attributes are.
</code></pre>
I welcome your feedback and questions. Thanks!