Re: how to set doc-string of new-style classes

2005-01-12 Thread harold fellermann
On 11.01.2005, at 19:35, Alex Martelli wrote: harold fellermann <[EMAIL PROTECTED]> 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__

Re: how to set doc-string of new-style classes

2005-01-11 Thread Peter Otten
harold fellermann wrote: > programm execution and should therefore be forbidden!" 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. That's what the dict parameter is for: >>> T = type("T", (o

Re: how to set doc-string of new-style classes

2005-01-11 Thread Alex Martelli
harold fellermann <[EMAIL PROTECTED]> 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 -- http://m

how to set doc-string of new-style classes

2005-01-11 Thread harold fellermann
Hello, does anyone know a way to set the __doc__ string of a new style class? Any attempt I tried results in the following error: Python 2.4 (#1, Dec 30 2004, 08:00:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more informati