M
Michael
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?
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?