[Cython] [mailinglist] Re: resolving name conflict -- does not work for enums !?
Uwe Schmitt
uschmitt at mineway.de
Mon Oct 6 12:38:14 CEST 2008
Greg Ewing schrieb:
> 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.
>
Thanks, that works now.
Greetings, Uwe
--
Dr. rer. nat. Uwe Schmitt
F&E Mathematik
mineway GmbH
Science Park 2
D-66123 Saarbrücken
Telefon: +49 (0)681 8390 5334
Telefax: +49 (0)681 830 4376
uschmitt at mineway.de
www.mineway.de
Geschäftsführung: Dr.-Ing. Mathias Bauer
Amtsgericht Saarbrücken HRB 12339
More information about the Cython-dev
mailing list