[Pyrex] Defining a static char**

Franck Pommereau pommereau at univ-paris12.fr
Thu May 15 19:10:32 CEST 2008


Dear all,

I'm wondering how I can translate the following C declaration in Pyrex:

     char *names[3] = {"X","Y","Z"};

If I just write it, prefixed by cdef Pyrex is complaining about the 
initialisation. If I try with Cython, it is complaining about {} which 
denotes a dict, but if I use a list or a tuples, its complaining about 
the fact it cannot convert it. The same occurs with Pyrex if I separate 
the declaration and the initialisation on two lines.

Currently I use a workaround: putting the declaration in a .h file and 
including it from the .pyx, but it's not convenient and neither elegant...

Thanks in advance for any help,
Franck



More information about the Pyrex mailing list