how to set doc-string of new-style classes

Alex Martelli aleaxit at yahoo.com
Tue Jan 11 13:35:08 EST 2005


harold fellermann <harold.fellermann at upf.edu> wrote:
   ...
> But, I cannot
> even find out a way to set the doc string, when I CREATE a class using
> type(name,bases,dict) ... At least this should be possible, IMHO.

>>> x=type('x',(),dict(__doc__='hi there'))
>>> x.__doc__
'hi there'



Alex



More information about the Python-list mailing list