[Cython] Multiple modules in one compilation unit

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 3 21:04:10 CET 2011

Lisandro Dalcin wrote:
> However, in Python
> 3 that is not te case (and only for the .so, for .py is the same as in
> Py2), the import machinery adds the entry later, after the
> finalization of the module init function.

Might be an idea to raise this issue on python-dev, to see
if there is a reason for this and whether it could be changed.

> I'm tempted to workaround
> this by setting the entry in sys.modules right after the call to
> PyModule_Create() ... What do you think about this?

It's worth a try. I can't think of anything it might break
offhand -- but then I'm not really up with the play on what's
been happening to the importing machinery over the years.


More information about the cython-devel mailing list