Decorators in Python

What is a decorator in Python? A decorator is a special function of python that adds some extra functionalities to a normal function without modifying the original code. In other words, decorators act like a wrapper around a normal function. Why there is a need for a decorator? Since decorators can add more functionalities to an existing function, developers don’t have to rewrite the whole code. They will only write the code that will do the extra work. Therefore, features of base functions can be enhanced without understanding/some understanding of underlying logic. What are the different parts of a decorator?

Read More