December 2000
Intermediate to advanced
816 pages
16h 57m
English
In the case where we have a variable number or extra set of keyword arguments, these are placed into a dictionary where the “keyworded” argument variable names are the keys, and the arguments are their corresponding values. Why must it be a dictionary? Because a pair of items is given for every argument—the name of the argument and its value—so it is a natural fit to use a dictionary to hold these arguments. Here is the syntax of function definitions which use the variable argument dictionary for extra keyword arguments:
def function_name([formal_args,][*vargst,] **vargsd): function_documentation_string function_body_suite
To differentiate keyword variable arguments from non-keyword informal ...
Read now
Unlock full access