[Pyrex] cimport across directories

Martin Albrecht malb at informatik.uni-bremen.de
Fri Jun 16 08:58:46 UTC 2006


On Friday 16 June 2006 06:35, you wrote:
> This isn't a bug. You need to name the .pyx and .pxd files
> using the full dotted name that the module will eventually
> have in the package hierarchy. For example, a module called
> spam that will reside in a package called foo should have
> source files named "foo.spam.pyx" and "foo.spam.pxd".
>
> This is not officially documented yet, because I haven't
> decided on the best way of dealing with the issue. But that's
> how it currently works.

I tried to apply your suggestion to William's old toy example at

http://modular.fas.harvard.edu/talks/pyrex/cimport.tgz

but had no success. I have a subdirectory 'ring' which contains ring.integer.
[pxd|pyx] and ring.rational.[pxd|pyx] (I renamed them). I also have a file 
called ex.pyx which does

cimport ring.integer
cimport ring.rational

etc.

Pyrexc complaints when called like this:

pyrexc -I`pwd`/ring ex.pyx

'ring' redeclared

What am I missing?

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_icq: 177334829
_jab: martinralbrecht at jabber.ccc.de



More information about the Pyrex mailing list