Descriptors were introduced to Python way back in version 2.2. They provide the developer with the ability to add managed attributes to objects. The methods needed to create a descriptor are __get__
, __set__
and __delete__
. If you define any of these methods, then you have created a descriptor.
Descriptors power a lot of the magic of Python’s internals. They are what make properties, methods and even the super function work.