Blog Post #139: Understanding Decorators, Part 3: The @ Syntax
In Post #138, we successfully built our first decorator by manually “wrapping” a function. We defined our original function, passed it to a decorator function, and then reassigned the returned wrapper back to the original function’s name. This manual process, say_whee = my_decorator(say_whee), works perfectly and clearly reveals the mechanics of how a decorator works. … Read more