[Cython] Class module names do not respect package hierarchy

Stephane DROUARD stephane.drouard at st.com
Tue Oct 28 11:52:53 CET 2008


Greg Ewing <greg.ewing at ...> wrote:

> I'm not sure exactly how this works in Cython at the moment,
> but you may find the following information about Pyrex
> useful:
> 
>
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/
source_files.html#mozTocId146379

It is written:

"If your module is destined to live in a package, the Pyrex compiler needs
to know the fully-qualified name that the module will eventually have.
...
This will ensure that the __name__ properties of the module and any classes
defined in it are set correctly. ..."

The patch I'm proposing avoids having to declare/know the package structure
at compile time, but determines it at runtime.

This is the way Python modules behave.

Stephane



More information about the Cython-dev mailing list