Python 101 : Decorators workflow - A simple example -



Below is an example of a decorator function that uses the arguments of the original function - non-decorated function -.



Remark:

The numbers describes the flow of the execution of the program.
We see that the nested function "wrapped_func" takes the arguments of the original function "func" - in our example, the parameters "3" amd "6" - using "*args" and "**kwargs".

Comments

Leave as a comment:

Archive