Decorator Tricks for Data Scientists

If you are not using Python decorators yet, you should. Pure syntactic sugar.

Diego Barba
Towards Data Science
6 min readJun 28, 2022

--

Image by author.

I remember the first time I saw an “@” sign on top of a function in Python code. I felt compelled to research what was this weird syntax. It marked a before and after, that is for sure. The “@” sign on top of the function is called a decorator, a function of the function it…

--

--