[Pyrex] [Mac Inter Core Duo OS 10.4.9 ] extern C class decl. requires module specification

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Jun 14 02:40:23 UTC 2007


David L Goldsmith wrote:

> But which Python module namespace does my C class belong to?  How do I 
> make my C class part of a Python module namespace?

If your Pyrex file is called "foo.pyx", then its Python
module name is "foo".

But if you're just trying to access an extension type
defined in one Pyrex module from another Pyrex module,
don't make it an extern class -- use the cimport
mechanism instead. See "Sharing Declarations Between
Pyrex Modules" in the Language Overview.

You only need to use extern extension types if you
need access to the internals of a non-Pyrex extension
type from Pyrex, or vice versa.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list