On Mar 18, 2009, at 10:49 AM, Carl Witty wrote:

> On Wed, Mar 18, 2009 at 10:22 AM, Stefan Behnel  
> <[email protected]> wrote:
>> I don't have sage to test this, but is this using the latest  
>> Cython? I
>> remember that Robert fixed a couple of things regarding header  
>> include
>> order, and it might have been after the 0.10 releases.
>
> This would have been with Cython 0.10.3.  I'll check this evening to
> see if the problem persists with Cython 0.11, if nobody beats me to
> it.

In Cython 0.11, the headers appear exactly in the order that they are  
given in the source files, without duplication. If I include or  
import a file, all (recursively) included .h files are included at  
that point in the sequence. An example should make things clearer.

--------------------- car.pyx ----------------

cdef extern from "a.h":
     pass

cdef extern from "b.h":
     pass

cimport engine

cdef extern from "z.h":
     pass

cdef extern from "y.h":
     pass

-------------- engine.pxd -----------------

cdef extern from "a.h":
     pass

cdef extern from "c.h":
     pass

cdef extern from "y.h":
     pass


----------------------------------

Will result in

# include "a.h"
# include "b.h"
# include "c.h"
# include "y.h"
# include "z.h"

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to