> At Friday 10/11/2006 14:11, Alan G Isaac wrote: > >class Params: > > def __init__(self,**kwargs): > > #set lots of default values > > ... > > #set the deviations from defaults > > self.__dict__.update(kwargs) > > > >Is this a reasonable approach overall? > >(Including the last line.)
"Gabriel Genellina" wrote in message news:[EMAIL PROTECTED] > I'm not sure what you want to do exactly, but a class attribute acts > as a default instance attribute. Yes. I am sorry my question was not clearer. There are *many* parameters, and the list can change, so I want to avoid listing them all in the Param class's __init__ function, using the strategy above. Q1: Is this approach reasonable? (This is a newbie question about unforseen hazards.) Q2: Is it horrible design to isolate the parameters in a separate class? (Comment: currently several classes may rely on (parts of) the same parameter set.) Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list