> > I have a class that takes a bunch of optional arguments. They're all > optional, with default values of various types. For simplicity, let's say > some are ints and some are floats: class Spam: > def __init__(self, bashful=10.0, doc=20.0, dopey=30.0, > grumpy=40, happy=50, sleepy=60, sneezy=70): > # the usual assign arguments to attributes dance... > self.bashful = bashful > self.doc = doc > # etc.
This looks like a situation where the GoF Builder pattern might help -- Gerald Britton, MCSE-DP, MVP LinkedIn Profile: http://ca.linkedin.com/in/geraldbritton -- https://mail.python.org/mailman/listinfo/python-list