replay 'apply' with extended call

Andrew Dalke adalke at
Mon Oct 25 08:32:39 CEST 2004

Alan G Isaac wrote:
> apply_each = lambda fns, args=[]: map(apply, fns, [args]*len(fns))

> What is the equivalent with extended call syntax?

How about a solution which replaces the 'map' with a
list comprehension?

def apply_each(fns, args = []):
   return [fn(*args) for fn in fns]

Conversion to lambda form is trivial for this case but I
figured if you're going to name it, why use a lambda?

				dalke at

More information about the Python-list mailing list