script question

Arnaud Delobelle arnodel at googlemail.com
Fri Apr 17 21:29:58 CEST 2009


"D'Arcy J.M. Cain" <darcy at druid.net> writes:

> On 17 Apr 2009 07:03:18 -0700
> aahz at pythoncraft.com (Aahz) wrote:
>> Go to all that trouble, you might as well make it easier:
>> 
>> for func in funclist:
>>     func()
>
> And if you need the return values:
>
>     retlist = [func() for func in funclist]

And if you don't want to be Python 3 compliant:

    retlist = map(apply, funclist)

-- 
Arnaud



More information about the Python-list mailing list