In this section, we're going to look at one of the most ubiquitous function decorators. We'll see how to construct a decorator, how to use it, and how it works.
The basic definition of a decorator is simple. It's just a function that takes another function as its input, does something with it, and then returns the result of its operations, as shown here:
The return value replaces the original input function, so the changes a decorator can make are potentially quite drastic. A decorator that doesn't change anything at all is a function that accepts one parameter and immediately returns it.