[Cython] How to define C-consts in python module scope

Robert Bradshaw robertwb at math.washington.edu
Tue Jul 19 05:52:35 CEST 2011

On Mon, Jul 18, 2011 at 4:34 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Chris Colbert wrote:
>>    cdef public enum:
>>       EV_READ  = 1
>>       EV_WRITE = 2
>>    However, I do not like it, because I would like to use "public" for
>>    other meaning (API generation).
> My suggestion is
>  cdef exposed enum:
>    ...

I agree, public is an overloaded word. This meaning is analogous to
its use for cdef class members. Perhaps we should use "api" for api
generation, and public used for Python-level access, with cpdef being
the preferred form for declaring Python-accessible types.

- Robert

More information about the cython-devel mailing list