[Cython] cdef class and docstrings

David Cournapeau cournape at gmail.com
Fri Dec 12 13:58:32 CET 2008


On Fri, Dec 12, 2008 at 2:07 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
>
> Stefan Behnel wrote:
>> David Cournapeau wrote:
>>> I would prefer to have at
>>> least the signature of __init__ (for default arguments)
>>
>> Cython can embed the signature of a function or method in its docstring.
>> However, my guess is that this doesn't work for __init__ yet, where it
>> would have to put it into the respective class (at least, there's no test
>> for that).
>
> Works now.
>
> http://hg.cython.org/cython-devel/rev/31644ed14440

What kind of docstring should I expect for something like:

cdef class Yo:
    "Some doc."
    def __init__(self, yo=None):
        "init doc"
        pass

I tried using cython-devel with your including changes, and I can't
see any difference, but maybe I am not looking at the right place (the
signature is supposed to be in Yo.__doc__, right ?)

David


More information about the Cython-dev mailing list