[Cython] [cython-users] Cython .pxd introspection: listing defined constants

Stefan Behnel stefan_ml at behnel.de
Sun Feb 20 10:38:19 CET 2011

W. Trevor King, 20.02.2011 03:32:
> On Sat, Feb 19, 2011 at 04:41:27PM -0800, Robert Bradshaw wrote:
>> On Sat, Feb 19, 2011 at 3:31 PM, W. Trevor King wrote:
>>> I think it's better to keep cdef meaning "backed by C data", not
>>> necessarily "written using C syntax", since you're trying to do more
>>> with Cython, so it doesn't make sense to force C syntax.
>> It means both. Were I to start over, I would make "cdef int* a, b, c"
>> declare three pointers


> but we're stuck with the C syntax we have...

Sadly, yes. This will be impossible to change in the future without 
breaking all sorts of code in a hard-to-fix-automatically way.

>> In a struct "cdef" on members is entirely redundant
> As it is in a cdef class.

Not quite. The class body of (cdef) classes can potentially contain code, 
so it's important for the parser to know what is a declaration and what is 
an executable statement.


More information about the cython-devel mailing list