[Pyrex] C-API implementation in Pyrex 0.9.6
Stefan Behnel
stefan_ml at behnel.de
Tue Oct 16 12:43:34 CEST 2007
Stefan Behnel wrote:
>> I forgot to mention that this uses a package local import, so the first lines
>> of lxml/objectify.pyx look like this:
>>
>> from etree cimport _Document, _Element, ElementBase
>> from etree cimport _ElementIterator, ElementClassLookup
>> from etree cimport elementFactory, textOf
>> cimport etree as cetree
>
> I think the problem here is that __Pyx_ImportModule() does not take the
> current package into account. I'll fix it to first try an import based on the
> package of the current module and then try a global import.
I also think that Pyrex should not re-import a module for each type it wants
to cimport from it, but rather import each required module once, store it in a
global variable, and reuse it whenever it is accessed by generated code. I'll
see if I can fix this while I'm at it.
Note that I'm fixing this in the merged Cython, but it shouldn't be too hard
to transmogrify the fix for plain Pyrex.
Stefan
More information about the Pyrex
mailing list