> Probably the simplest thing is to just add the attributes after the
> class body, e.g.::
>
>      >>> class MyClass(object):
>      ...     pass
>      ...
>      >>> for attr in ['attr1', 'attr2']:
>      ...     setattr(MyClass, attr, MyDesc(attr))
>      ...
>      >>> c = MyClass()
>      >>> c.attr1
>      'blah'
>

That worked.  Thanks.


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to