Arguments for map'ped functions

Peter Otten __peter__ at web.de
Thu Feb 5 08:09:29 EST 2009


mk wrote:

> So I have this function I want to map onto a list of sequences of
> *several* arguments (while I would want to pass those arguments to each
> function in the normal fashion). I realize this is contrived, maybe an

You can either use a list comprehension

[f(*args) for args in seq]

or starmap()

list(itertools.starmap(f, seq))

Peter



More information about the Python-list mailing list