Mike Meyer <[EMAIL PROTECTED]> writes: > When it was suggested that a facility for doing this be added to the > language, I asked for a use case for it. Nobodies come up with a > reason for placing such restriction on the client yet. If you've got a > use case, I'd be interested in hearing it.
I see it the other way; almost all the time in my own code I try to initialize all of any instance's attributes in an __init__ method. Dynamically adding attributes is useful sometimes, but done willy-nilly leads to spaghetti code. In the cases where it's useful, I'd rather see it done through a special __setattr__ method, perhaps inherited from a mixin: class Frob(Whatsit, DynamicAttributeMixin): ... However, that's not likely to happen. -- http://mail.python.org/mailman/listinfo/python-list