On 11 March 2010 04:18, Stefan Behnel <[email protected]> wrote:
> Lisandro Dalcin, 10.03.2010 21:17:
>>>> We could get rid of structmember.h by using the transform+property
>>>> machinery Dag implemented long ago
>  >
>> Any suggestions about docstring generation? I mean:
>>
>
> First of all, there doesn't have to be a docstring. CPython won't generate
> one for you either, not for '@property' and not for class/instance attributes.
>

I know. But I see this feature similar to adding function signatures.
After all, it is not too much work.

> So IMHO it would be cleaner to stick to this:
>
>     "CTYPE ATTRNAME[ = DEFAULT]"
>
> An alternative is the argument type annotation syntax in Py3:
>
>     "ATTRNAME : CTYPE [ = DEFAULT]"
>

OK. You convinced me...

>
> I have a preference for the last one, as it looks very readable:
>

Me too, I'llgo for it

>
>  > 1) Should the docstring be generated inconditionally, or under the
>  > control of 'embedsignatures' ?
>
> If we provide the definition as docstring, requiring 'embedsignatures'
> sounds like the right thing to do. Note that the above may be considered
> leaking implementation details (C type and default value) and the embedded
> string also implies a a tiny bit of overhead for the module, so some users
> may want to disable it.
>

OK.

PS: Are you aware that default values does not apply here? Cython does
not support default values for cdef members... I cannot remember if it
was decided that this support should be in (after all, it is sugar for
saving lines in __cinit__).


-- 
Lisandro Dalcin
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to