June 2019
Beginner to intermediate
770 pages
19h 24m
English
A decorator can change the attributes of a function. Here is the list of attributes of a function:
|
__doc__ |
The docstring, or none |
|
__name__ |
The original name of the function |
|
__module__ |
The name of the module the function was defined in, or none |
|
__qualname__ |
The function's fully-qualified name, __module__.__name__ |
|
__defaults__ |
The default argument values, or none if there are no defaults |
|
__kwdefaults__ |
The default values for keyword-only parameters |
|
__code__ |
The code object representing the compiled function body |
|
__dict__ |
A namespace for the function's attributes |
|
__annotations__ |
The annotations of parameters, including 'return' for the return annotation |
|
__globals__ ... |
Read now
Unlock full access