Managing Attribute Access and Descriptors (Theory of Python) (Python Tutorial)

If you want to control how attributes are accessed or assigned to, you can use the special methods __getattr__, __setattr__ and __delattr__. You can also use descriptors which use the special methods __get__, __set__ and __del__. There are three built-in descriptors that cover pretty much every special case: @property, @staticmethod and @classmethod.

Join me on Discord:

Support me by buying from Amazon through my affiliate link:

Here’s my Patreon account if you want to give me money:

Other ways to support Real Physics:


Thank you!

Post Author: hatefull