handling many default values

Michele Simionato michele.simionato at gmail.com
Mon Nov 13 17:33:31 CET 2006


Alan Isaac wrote:
> Also, as an aside, no one objected to using
>     self.__dict__.update(kwargs)
> in the __init__ function of the parameter holding class.

It is a common trick, also shown in the Python cookbook, IIRC. If you
are anal about
double underscores, you can also use

vars(self).update(kwargs)

              Michele Simionato




More information about the Python-list mailing list