[Pyrex] [PATCH] 'include' statements inside 'cdef class' level

Robert Bradshaw robertwb at math.washington.edu
Fri Sep 7 22:58:15 CEST 2007


On Sep 5, 2007, at 1:57 PM, Greg Ewing wrote:

> Robert Bradshaw wrote:
>> I'm also curious, Greg, what was your reasoning to make this explicit
>> restriction in the first place
>
> It was easier to implement includes at the top level only,
> and that was sufficient for the use case I had in mind at
> the time. That was before the cimport mechanism existed,
> and the include statement was the only way of breaking a
> large module into separate files.
>
> When I introduced cimport, I regarded include as being
> mostly obsoleted by it, so I didn't have much motivation
> for extending include's functionality.

Makes sense. One of the primary ways that we use pxi files is as  
header files, e.g. they are list of

cdef extern from "blah":
     ...

This makes using libraries like GMP practical, and also provide an  
easy interface to the whole of the Python/C API (though fortunately  
Pyrex is so awsome that you rarely need to use those functions  
directly).

- Robert





More information about the Pyrex mailing list