[Pyrex] Is this a bug or am I doing it wrong?

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Apr 14 07:46:33 CEST 2004


Gary Bishop <gb at cs.unc.edu>:

> I'm building a module "matrix" to be included in a package "my" using 
> Pyrex.
> 
> Is there a way to tell Pyrex that the module is going to reside inside 
> a package?

Yes, there is, but it's currently undocumented (since I'm not at all
sure that I want to make it the official way).

The trick is that you name the .pyx file with the fully qualified name
that it will eventually have in the package hierarchy, i.e. in your
case,

  my.matrix.pyx

(This will also be important if you ever want to cimport an extension
type from another Pyrex module that lives in a different package,
since the module doing the cimport needs to know the absolute path to
the module being cimported from. If you need any help with that case,
let me know.)

This feature is very under-tested at the moment, so use it at your own
risk.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list