On Tue, 07 Aug 2007 09:25:32 -0700, Bob B. wrote: > Ok, that "exec" is an ugly hack. There's gotta be someway to plop > this straight into the class's __dict__ without doing that, but when I > try adding self.__class__.__dict__[attr] = MyDesc(attr) in MyClass's > __init__ method, I get the error: "TypeError: 'dictproxy' object does > not support item assignment"
Does ``setattr(self.__class__, attr, MyDesc(attr))`` work? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list