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

Vitja Makarov vitja.makarov at gmail.com
Mon Jul 18 11:38:33 CEST 2011


cdef enum:
     EV_READ  = 1
     EV_WRITE = 2

Is there a way to put this constants into module dict?
I want to access this constants from pure python code, I tried this way:

globals()['EV_READ'] = EV_READ
globals()['EV_WRITE'] = EV_WRITE

But I don't like it, is there any other way?

-- 
vitja.


More information about the cython-devel mailing list