My class MyClass reuses many default parameters
with a small number of changes in each instance.
For various reasons I decided to put all the
parameters in a separate Params class, instances
of which reset the default values based on keyword
arguments, like this:

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.)

Thanks,
Alan Isaac
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to