Automatic binding of **kwargs to variables

Peter Otten __peter__ at web.de
Sat Oct 29 10:17:06 CEST 2005


lbolognini at gmail.com wrote:

> I have a very long list of parameters coming from a web form to my
> method foo(self, **kwargs)
> 
> I would like to avoid manually binding the variables to the values
> coming through the **kwargs dictionary, just to keep the code cleaner,
> I'd like to bind them automatically

Why don't you just change the method signature to foo(self, x, y, z,
whatever, **kwargs)?

Peter




More information about the Python-list mailing list