[Cython] Intra-package reference not working with cimport

Robert Bradshaw robertwb at math.washington.edu
Mon Nov 3 18:28:49 CET 2008


On Nov 3, 2008, at 4:48 AM, Stephane DROUARD wrote:

> Stefan Behnel wrote:
>
>> Did you read the documentation on sharing declarations between  
>> extension
> modules? > Did you declare foo() public?
>
> I assume it's through cpdef, right? Then it does not solve the issue.
>
> Unless I missed something, declaring cpdef allows functions to be  
> callable
> by Python.
> Here, the problem comes from the genererated code of bar which  
> imports foo
> through PyImport_Import(), so letting globals to NULL, avoiding  
> Python to
> first try importing foo from the package bar resides.

cimport imports c definitions, which must be declared in .pxd files.  
Do you have a .pxd file? If not, that's probably the issue.

- Robert



More information about the Cython-dev mailing list