Hi

It seems to me like my post yesterday didn't make it to the subscriber,
at least not back to me although I should receive my own posts... which
is listed in the list archive.
So I repost me concern and hope I'll get a copy this time. If everyone
out there already got my first post, sorry for that.


I'm quite new to cython and try to bind some c code to python. Now I'm
not sure if I understood the cython doc correctly since what I'm trying
do do doesn't work :-(
It looks like this:

cdef class Cobj:
    cdef a_c_struct_t *loop

    def __init__(self):
        self.loop = c_lib_call()
        c_lib_call_reg_callback(<c_cb_t>self.callback, NULL)

    cdef void callback(self, void *userdata) with gil:
       # but here, self.loop seems to be NULL instead of something
       # to test this:
       # if self.loop == NULL: print "isNull"
       doSomething(self.loop)

in the callback self.loop is NULL but in the init it wasn't. is it
possible to access self and its members in a c callback? I also tried to
use __cinit__ or __new__ instead of __init__ but always the same behavior.

thanks fro your comments
martin
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to