[Pyrex] C-API implementation in Pyrex 0.9.6

Stefan Behnel stefan_ml at behnel.de
Sat Oct 20 15:45:37 CEST 2007


Greg Ewing wrote:
> What about imports from modules which aren't in the package?
> The only way to fix this by style enforcement would be to
> ban local cimports altogether and require all cimports to
> be absolute.

Ok, so what would be the right fix then? If we want to support a global
standard cimport directory for .pxd files, I would prefer splitting it up into
package subdirectories rather than filling it up with
"package.package.module.pxd" files. So that would mean Pyrex should look up
cimported .pxd files in a well defined search path.

If the .pxd is found in the current package directory, we know it's a
package-local import and can determine the full module name at compile time
(as we know the full name of the current module). Otherwise, we can search the
import path for the module name appended to the local package and if that is
not found either, search for the module name on its own. That way, we'd always
know at compile time what the full package name is.

Would that match your idea about package handling?

Stefan




More information about the Pyrex mailing list