expanding dictionary to function arguments

bruno at modulix onurb at xiludom.gro
Wed Nov 2 11:54:18 EST 2005


Noah wrote:
> Bruno Desthuilliers a écrit :
> 
>>Noah a écrit :
>>If you have control over the API functions declarations, makes them so:
>>def my_api_func(arg1='', arg2='whatever', **kwargs):
>>   code_here
> 
> 
> Unfortunately I cannot change the API functions.
> I should have mentioned that.

Yeps... That what I thought, but you didn't mention it, and it was not
that clear (or it's me being stupid...).

I'm no great expert, but apart from writing a generic decorator for the
API objects and decorating them all with your smart_apply function -
which won't by you much in this case imho -, I don't see a much better
solution...

Some guru around ???

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list