[Pyrex] C-API implementation in Pyrex 0.9.6

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Oct 12 10:39:25 CEST 2007


Stefan Behnel wrote:

> This is due to missing cimports in the .pyx file that cimports the API, which
> makes the generated .c file lack some header #includes.

I'm not sure I follow you there. Using cimport to import
functions shouldn't involve #includes at all -- Pyrex should
emit whatever declarations are needed directly into the .c
file.

Can you provide a cut-down example which illustrates the
problem?

> However, the missing
> header files are not required for the API, they only touch internally used
> objects that are not exported through the API but written into the module .h
> file.

All type declarations in a .pxd file get written into the
.h file, because they could potentially be used by functions
that are part of the API.

Anything which is truly internal to the module shouldn't be
declared in the .pxd and shouldn't be declared public, so it
shouldn't end up in the .h file. If that's happening somehow,
it sounds like a bug.

Again, an example would help to clear this up.

--
Greg



More information about the Pyrex mailing list