Uwe Schmitt wrote:

>     ----- minimal.pxd ------------------------
> 
>         cdef extern from "minimal.h":
> 
>             cdef enum test:
>                 A
> 
>     ----- minimal.pyx -------------------------
> 
>         cimport minimal
> 
>         A = minimal.A
> 
>     -------------------------------------------

You shouldn't be cimporting minimal in minimal.pyx. The files
minimal.pxd and minimal.pyx are two parts of the *same* module,
i.e. minimal. There's only one namespace, and you're trying
to define A as both a C constant and a Python global in that
namespace.

You need to put the definition of enum test into a different
module namespace, e.g.

   # mindefs.pxd
   cdef enum test:
     A

   # minimal.pyx:
   cimport mindefs
   A = mindefs.A

Note that you don't need a mindefs.pyx in this case -- you're
only using mindefs as a compile-time namespace.

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

Reply via email to