3 ms·
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, CPyt
by r4victor 6y ago
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:
- 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.
I welcome your feedback and questions. Thanks!
- alexpetralia 6y agoJust wanted to say I found your series incredibly valuable! Thank you.
- rytill 6y agoYou are providing immense valuable to your target audience. I would love to see an article about threading and asyncio.
- rytill 6y agoWhat are some of your favorite projects built with Python?
- r4victor 6y agoPelican. It took me an hour or two to set up this blog. Intuitive, flexible and well-documented.