June 2017
Beginner to intermediate
274 pages
6h 49m
English
To enclose a function in a wrapper, first we want the function to find the wrapper inside a decorator (refer to the following code example). If you haven't seen this before, it is exactly how it looks—the definition of a wrapper function actually lies inside of @ints_only. So when @ints_only is called, it defines and then returns the wrapper function.
When a function is defined inside another function, the containing function's local variables remain available to the inner function. Refer to the following code example:

In the preceding case, ...
Read now
Unlock full access