Python decorators (live edition) by Reuven M. Lerner

Python decorators (live edition)

All about one of Python's most powerful tools


One of the most powerful and advanced techniques that Python offers is known as a "decorator." Simply put, a decorator allows you to trap functions and classes when they are defined, and again when they are run, and do .... well, whatever you want with them.

Decorators are hard for many people to understand — what they do, when we would want to use them, and then how to go about doing so. In this class, recorded from an online session in July 2017, we do a deep dive into Python decorators, covering such topics as:

  • Built-in decorators (property, staticmethod, classmethod)
  • The idea behind decorating
  • Classes as decorators
  • Functions as decorators
  • Decorating methods
  • Decorators that take arguments
  • Uses for decorators
  • Tips and tricks

Note: This is a recording from an online course that I gave.  A more expanded version of this course, re-recorded and divided into sections for offline use, will be available in the coming months.  If you purchase this course, you will get access to that one for free.

This course includes not only the video, but also solutions to the (many) exercises, and the PDFs of slides that I have prepared for this course.

What's included?

Video Icon 1 video File Icon 3 files


Python decorators
(4h 01m 07s)
Slide PDFs
Basic decorators
49 KB
Advanced decorators
65.5 KB
Solutions to exercises
67.9 KB

Become a better developer.

I'm Reuven — and for 20 years, I've spent just about every day teaching Python, data science, and Git at some of the world's best-known companies. 

I've recorded my most popular courses here, for you to learn these skills — even if you don't work for a big company.

After taking my courses, you'll be able to to solve bigger problems in less time — allowing you to do your current job better, or to find a new, better job.


Do I need to be a Python expert to benefit from this course?

Decorators depend on a number of things: Treating functions and classes as objects, defining some magic methods, and understanding how parameters are passed (using *args and **kwargs).  If you are completely familiar with these, then you should be just fine learning about decorators.  If not, then I'd suggest learning about functions and classes — perhaps through some of my other books and courses!

What if I dislike the course?

If you don't think  you got value from the course, then ask for a refund, and I'll give you one.

What do you mean, this is a "live course"?

I gave this course live and online to a number of people in July 2017. The video available here is the recording of that course, including pauses during which people were working on exercises.  This course is being reworked to have even more content, but broken up into many smaller sections, without the pauses, and more appropriate for  learning in chunks from home (or work).

If you buy this course now, then you'll get the revamped version for free.