I have a function and I am trying to return a number and a vector of ints. What I have is
cdef func() nogil:cdef vector[int] vectcdef int a_number...return a_number, vect
but this will give errors like Assignment of Python object not allowed without gil
. Is there a workaround?
Cython has a ctuple
type http://docs.cython.org/en/latest/src/userguide/language_basics.html#types
%%cython -a -f -+
from libcpp.vector cimport vectorcdef (vector[int], double) func() nogil:cdef vector[int] veccdef double d = 3.14cdef int ifor i in range(10):vec.push_back(i)return vec, d