[Pyrex] C-API implementation in Pyrex 0.9.6
Stefan Behnel
stefan_ml at behnel.de
Fri Oct 19 09:52:48 CEST 2007
Greg Ewing wrote:
> Hacking __Pyx_ImportModule to look for a local
> module is *not* the right way to fix this, because
> it's only treating one symptom of the problem.
> Pyrex still has the wrong model of the module
> namespace at compile time, and this can lead to
> various other problems. For instance, if you
> also cimport 'package.export' somewhere, then
> Pyrex thinks there are two separate modules,
> 'export' and 'package.export'. Any extension
> types or C functions defined therein will get
> doubled up, and you'll get complaints about things
> like class 'export.Foo' and class 'package.export.Foo'
> being incompatible types.
Hmm, I didn't test that, could you explain why this should be a problem?
Cython knows the complete name of the module when generating it (as long as
you use distutils to build it), so the type names are always fully qualified
*inside* the module. Does Pyrex do anything to compare the type names against
what it thinks it should be in the importing module? If if does, maybe we
should fix that to remember the FQTN of the type *after* importing it?
Stefan
More information about the Pyrex
mailing list