Vladimir

32%
Flag icon
When parsing a decorator in source code, Python takes the decorated function and passes it as the first argument to the decorator function. So how do you make a decorator accept other arguments? The answer is: make a decorator factory that takes those arguments and returns a decorator, which is then applied to the function to be decorated.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview