Robert Bradshaw wrote: > On May 6, 2009, at 1:08 PM, Carl Witty wrote: >> Yes, but you said that you only implement it within a single module >> (which is what I see in element.c); I'm saying that it should also be >> possible to implement across modules (just make tp_new functions >> non-static, add an extern declaration in the second module, and call >> the function directly). > > Yes, I we could do this. We could also support exported cdef > functions this way, instead of the current function import mechanism. > (Or was there some reason it wasn't done this way in the first place?
There are two cdef function export mechanisms: "public" and "api". The second is targeted towards calling functions between separate extension modules (through "__pyx_capi"), while "public" (and declaration in the module .pxd file IIRC) simply removes the name mangling and makes functions non-static for use in other C files linked into the same extension module. So this would mimic the "public" mechanism in a way, although it'd be better to do the normal name mangling for tp_new() even if we export it. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
