actionargs func ( ,elseactionargs func ( etc action(*argscall func with one arg in this case call func with three args here dispatch generically this leverages both the formand the fact that functions are objects that may be both referenced byand called throughany variable more generallythis varargs call syntax is useful anytime you cannot predict the arguments list if your user selects an arbitrary function via user interfacefor instanceyou may be unable to hardcode function call when writing your script to work around thissimply build up the arguments list with sequence operationsand call it with starred-argument syntax to unpack the argumentsdefine or import func args ( , args +( ,args ( func (*argsbecause the arguments list is passed in as tuple herethe program can build it at runtime this technique also comes in handy for functions that test or time other functions for instancein the following code we support any function with any arguments by passing along whatever arguments were sent in (this is file tracer py in the book examples package)def tracer(func*pargs**kargs)print('calling:'func __name__return func(*pargs**kargsaccept arbitrary arguments pass along arbitrary arguments def func(abcd)return print(tracer(func = = )this code uses the built-in __name__ attribute attached to every function (as you might expectit' the function' name string)and uses stars to collect and then unpack the arguments intended for the traced function in other wordswhen this code is runarguments are intercepted by the tracer and then propagated with varargs call syntaxcallingfunc for another example of this techniquesee the preview near the end of the preceding where it was used to reset the built-in open function we'll code additional examples of such roles later in this booksee especially the sequence timing examples in and the various decorator utilities we will code in it' common technique in general tools special argument-matching modes