Decorators in Python: Powerful Patterns & Practical Uses

Haim Michael Haim Michael
Language: English
The presentation was given on 2025.09.09 at PyCon Israel 2025 - Conference.

Decorators are one of the most powerful and expressive features in Python, yet they can be confusing for many developers. In this talk, we’ll demystify decorators by exploring how they work, how to write them, and how to use them effectively.

This talk is designed for intermediate Python developers who want to take their skills to the next level by mastering one of Python’s most versatile features: decorators.

We’ll begin by revisiting the concept of functions as first-class objects, which sets the foundation for understanding how decorators operate. From there, we’ll walk through writing simple decorators, then progress to more advanced topics such as: + Decorators with arguments + Stacking multiple decorators + Class-based decorators + Decorators applied to methods and classes

Real-world examples will highlight how decorators are used in real-world applications, such as web development, logging, access control, and benchmarking.

Attendees will leave this talk with a clear mental model of decorators, the ability to confidently implement them, and inspiration to apply them in their own projects. This talk will also provide best practices and tips for keeping decorator logic clean, testable, and maintainable.

This talk can be delivered in Hebrew (my mother tongue) and English.