Decorators are one of Python's most powerful features. But for many developers, they remain somewhat mysterious and intimidating. In this tutorial, you'll learn what decorators are, how they work, how to write them, and when you should use them. Along the way, you'll write decorators that demonstrate their power, as well as some typical use cases — including for caching, filtering inputs, filtering outputs, timing, logging, and security. Along with the numerous hands-on exercises, there will be ample opportunities for questions and interactions. The Jupyter notebook that I'll use for teaching will be shared in real time with participants, and will also be available after the tutorial is over.
If you've always found decorators intimidating, or just wanted to know what they are, then this tutorial will answer your questions, as well as give you the confidence you need to use them in your own code.