All of the above examples lead to TypeErrors if your def uses *args (and optionally) **kwargs for a function that calls another function:
def a(x, y): print x, y def b(other, function, *args, **kwargs): function(*args, **kwargs) print other b('world', a, 'hello', 'dude')
Exit
hello dude world
Note that function , *args , **kwargs must be in that order and must be the last arguments to the function that calls the function.
sabujp Sep 16 '15 at 21:01 2015-09-16 21:01
source share