Step 2: the decorator skeleton
English · Dansk · Bahasa Malaysia
A decorator is a function that takes a function and returns another function. This skeleton only announces the call:

Run it with python -m speed_calc.lecture_steps 2.
What we gained
- Functions are values: you can pass them to other functions and return them.
- The inner
wrapper is a closure; it remembers function after skeleton has returned.
*args, **kwargs let the wrapper accept the arguments of any function and pass them on.
functools.wraps keeps the original name and docstring, so the decorated function still says fast_function.
@name above a function is shorthand for function = name(function).