dictionary that have functions with arguments

Leif K-Brooks eurleif at ecritters.biz
Wed Nov 2 08:30:10 CET 2005


Alex Martelli wrote:
> execfunc = { 'key1' : (func1, ()),
>                      'key2' : (func2, args) }
> 
> now, something like:
> 
> f, a = execfunc[k]
> f(**a)
> 
> will work for either key.

Shouldn't func1's args be a dictionary, not a tuple?



More information about the Python-list mailing list