The map
function is good way to parallelly compute function values. When the function has keyword parameters, how to use the map? For example:
def func(a, b=0, c=0):
print a, b, c
Sometimes, kwargs is convenient to pass parameters to function, ignoring the argument sequence to call. Can map function can be used like this?
map(func, range(3), c=[1, 3, 5])
However, it would be TypeError.
TypeError: map() takes no keyword arguments
Is there any simple way to continue use map()
with keyword arguments?