[Cython] What to do with modules

Kevin Ar18 kevinar18 at hotmail.com
Sat Oct 4 22:03:12 CEST 2008


As I understand the Docs, you can't access c types, functions, or classes in a module.  For example, this won't work:


somemodule.pyx

cdef int a = 1
py_get():
    return a

somefile.pyx

import somemodule
cdef int b = somemodule.a
print somemodule.py_get()

or this:

somemodule.pyx

cdef extern from *:
    int a = 1
py_get():
    return a

somefile.pyx

cimport somemodule
cdef int b = somemodule.a



So what do you do with modules that mix Cython and Python?
_________________________________________________________________
See how Windows connects the people, information, and fun that are part of your life.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/


More information about the Cython-dev mailing list