Reverse of map()?

Phillip Sitbon phillip.sitbon at gmail.com
Sun Feb 5 20:03:40 EST 2006


Hello there,

I have a situation where a list of functions need to be called with a
single set of parameters and the result constructed into a tuple. I
know there's simple ways to do it via list comprehension:

Result = tuple(  [ fn(* Args, ** Kwds) for fn in fn_list ]  )

I'd hope there's a more efficient way to do this with a built-in
function, so that I could call:

Result = rmap( fn_list, * Args, ** Kwds )

and have it constructed as a tuple from the get-go.

Is there a built-in function that would allow me to do this, or do I
have to go with the list comprehension?




More information about the Python-list mailing list