[Cython] 0.9.8.1.1 and .pxd files

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Oct 31 06:37:40 CET 2008


Lisandro Dalcin wrote:

> Python recognizes a PKGNAME directory as a pakage if '__init__.py' is
> there, if not, no way. BUT  if '__init__.so' is also there, it loads
> '__init__.so' !!! But then the exported module init function in the
> dynlib needs to be named initPKGNAME, and "PKGNAME" needs to be passed
> to Py_InitModule()
> 
> So, Greg, here you have the rules if you want to implement it ;-).

Okay, thanks. Sounds like I need to special-case the module
name when the last component is "__init__", or something like
that. I'll put it on the list of things to look into!

> PS: tried only in Py 2.5, this is surely undocumented, and probably it
> is in fact some bugy code in CPython's  'import.c' .

Yes, it would be better to get it made an officially supported
behaviour -- and to eliminate the need for the __init__.py to
be there as well.

-- 
Greg


More information about the Cython-dev mailing list