David Cournapeau wrote:
> On Wed, Dec 10, 2008 at 5:35 PM, Stefan Behnel wrote:
>> cdef class Yo:
>> "Some doc"
>
> Hm, why should the __init__ method belong to the class string ? Those
> are different, in my mind: the Yo.__doc__ tells about the Yo class
> purpose, and the Yo.__init__.__doc__ should give details about the
> construction
So, to construct an instance of a class, you would write
yo = Yo.__init__(...)
is it that what you are saying?
> The class docstring does work, though; the __init__ is:
>
> x.__init__(...) initializes x; see x.__class__.__doc__ for signature
>
> And Yo.__class__.__doc__ is:
>
> "type(object) -> the object's type\ntype(name, bases, dict) -> a new type"
As you can see, the docstring of __init__() is fine, but the class
docstring isn't. Extension classes behave like Python builtins (or vice
versa). Their special methods simply don't have a docstring (try
tuple.__init__.__doc__, for example). That's why the standard docstring
refers to the class docstring.
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev