[Cython] Intra-package reference not working with cimport

Stephane DROUARD stephane.drouard at st.com
Mon Nov 3 13:48:28 CET 2008


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.

Cheers,
Stephane



More information about the Cython-dev mailing list