Web: https://towardsdatascience.com/5-advanced-tips-on-python-decorators-113307d5a92c?source=rss----7f60cf5620c9---4

Jan. 25, 2022, 12:16 a.m. | Michael Berk

Towards Data Science - Medium towardsdatascience.com

Do you want to write concise, readable, and efficient code? Well, python decorators may help you on your journey.

Photo by Mauricio Muñoz on Unsplash

In chapter 7 of Fluent Python, Luciano Ramalho discusses decorators and closures. They are not super common in basic DS work, however as you start building production models writing async code, they become an invaluable tool.

Without further ado, let’s dive in.

1 — What’s a decorator?

Before we get into the tips, let’s …

computer science data science decorators on programming python python decorators tips

Research Scientist, 3D Reconstruction

@ Yembo | Remote, US

Clinical Assistant or Associate Professor of Management Science and Systems

@ University at Buffalo | Buffalo, NY

Data Analyst

@ Colorado Springs Police Department | Colorado Springs, CO

Predictive Ecology Postdoctoral Fellow

@ Lawrence Berkeley National Lab | Berkeley, CA

Data Analyst, Patagonia Action Works

@ Patagonia | Remote

Data & Insights Strategy & Innovation General Manager

@ Chevron Services Company, a division of Chevron U.S.A Inc. | Houston, TX