Stop fearing Python decorators
If I mention “decorators,” even if you’ve been programming with Python for a while, what comes to mind?
To many, decorators are mysterious and powerful — and beyond the reach of mere mortals. Their @ signs pop up in all sorts of places, from “pytest” to Flask to properties… but it’s not really clear what they are, what they’re doing, how they work, or how they can be useful.
Here’s the thing: If you are comfortable writing functions and classes in Python, then you can write decorators. And once you start, you’ll wonder how you lived without them.
I’ve taught decorators to engineers at some of the world’s largest companies, and also at conferences like PyCon and Euro Python. And this Sunday, I’ll be teaching a live, online course all about decorators.
Once you’re done with the course, you’ll be able to write and understand a wide variety of decorators, from those that filter arguments to those that cache function results and monitor your code’s performance.
I’m running these class like I do my corporate training: With lots of time for Q&A, and a ton of hands-on exercises. Without slides, as I live-code into Jupyter. We’ll even have a private forum, so you can ask questions when the class is done. And of course, you’ll have access to the video recording.
Questions? Comments? Eligible for a discount (for students, retirees/pensioners, or people living outside the world’s 30 richest countries)? E-mail me at firstname.lastname@example.org or get me on Twitter as @reuvenmlerner, and I’ll answer ASAP.