On Fri, Oct 31, 2008 at 4:46 AM, Stefan Behnel <[EMAIL PROTECTED]> wrote: > 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() >> >> 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' . > > What makes you think that this is different from the normal behaviour of > loading binary modules before loading Python modules? > > I think there's a difference between "recognising a package as such when > finding an __init__.py" and "loading the package module". The latter > should use the normal module loading machinery for loading the module > "PKGNAME.__init__" (note the missing .py). >
Well, it was just the name of the module init function being initPKGNAME. But thinking a bit more, perhaps this do really make sense, and all is fine. I just was too lize to look at 'import.c', it is a not easy place to dive into near the midnight ;-). -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
