The Magic of Decorators: Human-Mastered Python for Essential Patterns

Dr. Klaus Bremer

Friday, 17 April 8:00 - 12:00 incl. breaks, 3.5 hours

Decorators Functions Closures Better-Than-AI

Space is limited 👉 Get your ticket for The Magic of Decorators: Human-Mastered Python for Essential Patterns in our ticket shop

Decorators are powerful tools to hide complexity in a program and improve the readability of the code. Decorators allow to wrap functions and inject additional code to get executed before and/or after a function call. They can also be used to partly substitute metaclasses.

These sophisticated patterns are crucial for writing robust Python code, especially since they are often complex enough to be challenging for current coding agents and large language models to generate correctly, making human mastery essential.

Especially beginners may wonder about the @-syntax and what kind of magic happens there.

In this tutorial I will uncover this magic and we learn about function-wrapping and accessing namespaces by closures. Both the function-based and the class-based approach will be introduced, as well as best practice.

This tutorial is partly hands-on with a workshop style: a laptop with a Python installation is required. There will be time for exercises at different levels to get comfortable with the topics.

What You Will Learn

Audience

Some experience: attendees should be comfortable with Python functions. Also a basic understanding of classes is helpful.

After the tutorial students will walk out with a basic understanding about the underlying mechanism of decorators and will be able to write at least basic decorators on their own.

Your trainer: Dr. Klaus Bremer

Dr. Klaus Bremer got in contact with Python about 1999, began programming even earlier and is maintainer of several open-source libraries. In 2014, he started giving professional trainings, which have summed up since then to more than 200 courses (most often multi-day workshops), from basic introductions up to advanced and specialized topics.

Space is limited 👉 Get your ticket for The Magic of Decorators: Human-Mastered Python for Essential Patterns in our ticket shop