[Cython] Cannot convert pointer to Python Object
Robert Bradshaw
robertwb at math.washington.edu
Fri Jul 24 13:49:50 CEST 2009
Note that you can declare at foo_t to be a member of Bar directly, so
you don't even need to allocate it (this works if you're not getting
it as a pointer from elsehwhere). For example
cdef extern from "foo.h":
ctypedef struct foo_t:
int fd
cdef some_c_func(foo_t*)
cdef class Bar:
cdef foo_t foo
cdef __init__(self, n):
self.foo.fd = n
def call_something_on_foo(Bar b):
some_c_func(&b.foo)
- Robert
More information about the Cython-dev
mailing list