The first time I came across the decorators in Python was when I was deploying my model using Flask. I was going through the Flask documentation and came across a decorator function, which reads like @app.route(“/”) . I was intrigued and started reading more about it and realized that concept of decorators is very interesting and useful.

If you also came across a something like @some_function written over some other function, and you are curious to know about it then you should go through this article. The concept of decorators is considered a little bit hard to crack and this article attempts to simplify the understanding of decorators.

Let us quickly go through the foundations and the building blocks to understand the concepts.

#data-science #machine-learning #python #flask #python-programming

Curious Case of Decorators in Python
1.10 GEEK