At Monday 13/11/2006 13:33, Michele Simionato wrote:
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)
Not good - that relies on vars() returning the actual __dict__.
From <http://docs.python.org/lib/built-in-funcs.html>:
"The returned dictionary should not be modified: the effects on the
corresponding symbol table are undefined."
--
Gabriel Genellina
Softlab SRL
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
--
http://mail.python.org/mailman/listinfo/python-list