Built-in Decorators
We'll cover the following...
Python comes with several built-in decorators. The big three are:
- @classmethod
- @staticmethod
- @property
There are also decorators in various parts of Python’s standard library. One example would be functools.wraps. We will be limiting our scope to the three above though.
@classmethod and @staticmethod
I have never actually used these myself, so I did a fair bit of research. The <*@classmethod>* decorator can be called with with an instance of a class or directly by the class itself as its first argument. According to the Python documentation: It can be ...