#----------------------------------------------------------------------------
class Obj(object):
#----------------------------------------------------------------------------
""" Multi-purpose class """ #---------------------------- def __init__(self, **kwargs): #---------------------------- self.__dict__.update(kwargs)
Normally I'd just use class Obj(object): pass, but the advantage to this method is you can create an Obj like this:
Obj(id="desktop", last=0, color=self.getColor(DESKTOP_COLOR))
You can pass all the attributes you want the object to have this way. Nifty :)
Sorry if this has been posted before, but I haven't seen it. -- http://mail.python.org/mailman/listinfo/python-list