tags:

views:

145

answers:

1

I'm doing some Python coding in a clients code base and I stumbled on a line of code that looks something like this (the variable names have been changed to protect the innocent):

reply = function1(a=foo, **function2(bar, b=baz))

Normally ** in the argument list collects remaining keyword arguments but what do they do in front of the function name?

+11  A: 

I'd say that this is just calling a function that returns a dict-like object and therefor the asterisks just convert the returned dict into the keyword arguments for function1, just as usual.

Horst Gutmann
Of course! You're right. Now I see it too... :)
Jörgen Lundberg