equivalent functions?

wietse wietse.j at gmail.com
Fri Feb 10 20:30:57 EST 2006


Hello,

I'm reading "Text processing in Python" by David Mertz. In there he
defines a function

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

I thought that this would be equivalent to:

apply_each = lambda fns, args=[]: [f(args) for f in fns]

Can anybody confirm this? If not, how are they different?
Thanks,
Wietse




More information about the Python-list mailing list