what is the idiom for copy lots of params into self?

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Thu Jan 11 12:20:42 EST 2007


Emin wrote:

> Thanks for your suggestions. One issue with using *args or **kw is
> that I might no want to copy all the arguments to __init__ into
> self.

Try prepending something like

allowedParms = ("spam", "eggs", "yum")
args = dict([key,val for key,val in args.elements() if key in
allowedParms])

Regards,


Björn

-- 
BOFH excuse #64:

CPU needs recalibration




More information about the Python-list mailing list