#descriptor-protocol

[ follow ]
fromRealpython
1 day ago

Python Descriptors: An Introduction Quiz - Real Python

By working through this quiz, you'll revisit the descriptor protocol, how .__get__() and .__set__() control attribute access, and how to implement read only descriptors. You'll also explore data vs. non-data descriptors, attribute lookup order, and the .__set_name__() method.
Python
fromAntocuni
6 months ago
Python

Inside CPython's attribute lookup - Antonio Cuni's blog

Attribute lookup in Python is more complex than checking instance __dict__ then type; descriptors, instance vs type lookup, and metaclasses affect behavior.
[ Load more ]