Function application optimization.
bdesth.nospam at removeme.free.fr
Fri Dec 12 12:59:32 CET 2003
Jacek Generowicz wrote:
> fncs = [func1, func2, ..., funcN]
> args = [arg1, arg2, ..., argN]
> How should one spell
> results = map(lambda f,a: f(a), fncs, args)
> in order to get the result most quickly ?
I dont know if it will be faster (timeit might tell you this), but what
about something as simple stupid as:
results = 
nbfuns = len(fncs)
for i in range(len):
Note that you must have at least len(fncs) args.
More information about the Python-list