June 2019
Beginner to intermediate
770 pages
19h 24m
English
We construct decorated functions in two stages. The first stage is the def statement with an original definition.
A def statement provides a name, parameters, defaults, a docstring, a code object, and a number of other details. A function is a collection of 11 attributes, defined in section 3.2 of the Python Standard Library, which is the standard type hierarchy.
The second stage involves the application of a decorator to the original definition. When we apply a decorator, (@d), to a function (F), the effect is as if we have created a new function,
. The name, F, is the same, but the functionality can ...
Read now
Unlock full access