11.6.3. Calling Functions with Variable Argument Objects

Python 1.6 introduces the ability to explicitly provide groups of variable arguments, both a non-keyword tuple and/or a keyword dictionary. In each of the above examples of variable arguments, the variable arguments provided for in the invocation include individual arguments (see all the examples in the preceding section). Prior to 1.6, this was the only way to call a function with a variable number of arguments.

Function calls have the added ability to take a tuple with contents that will go straight to the non-keyword variable argument tuple and a dictionary containing key-value pairs to add to the keyword variable argument dictionary. The tuple and dictionary may be joined in the function ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.