help with map function

Michael michael.mata at gaigen.net
Fri Oct 22 03:43:30 EDT 2004


In the book 'Text Processing Python,' they present a function that I'm
having a real hard time understanding.

apply_each = lambda fns, args=[]: map(apply, fns, [args]*len(fns))


I understand that the lamda statement is passing a function that
accepts a function and an iterable variable as arguments.

The function passed by lamda is a map statement that maps the function
in the arguement list against each item in the iterable variable.

However, I don't understand what is happening in the 3rd arguement of
map though.  What does [args]*len(fns) do?



More information about the Python-list mailing list