[Cython] Class module names do not respect package hierarchy
Stephane DROUARD
stephane.drouard at st.com
Thu Oct 30 19:14:35 CET 2008
Greg Ewing wrote:
> When a module cimports an extension type from another
> module, code is generated to import the type object at
> run time. To do this, the Pyrex compiler needs to know
> where the other module is in the module namespace. If
> it gets moved somewhere else, the import will fail.
Yes, and this is how Python behaves. A module which imports a sub-module
needs to know how to get it.
So having "cimport pkg.foo" that will be translated to "import pkg.foo" is
normal.
My request is different: I would remove the constraint to fix modules'
location (not the sub-modules they eventually import) at compile time.
So when we compile foo.pyx, we don't have to inform Pyrex that foo.pyd will
be in pkg.
More information about the Cython-dev
mailing list