Resources
- https://realpython.com/python-descriptors/
- https://python-course.eu/oop/introduction-to-descriptors.php
- https://www.youtube.com/watch?v=mMbVs17Vmo4
What are the descriptors?
Descriptors are Python objects that implement a method of the descriptor protocol, which gives you the ability to create objects that have special behavior when they’re accessed as attributes of other objects.
Examples:
- We can use @property decorator, used to make pre-build validation before saving.
- staticmethod, classmethod are also descriptors
- functions also use get, set, delete dunder methods. And get returns the bound version of the method
Another example: