Can we create a C-array of Python objects in Cython?
Let's consider the following code:
class C:
pass
cdef object f():
return C()
cdef void g(unsigned n):
cdef object obj0 = f()
cdef object obj1 = f()
cdef object obj2 = f()
cdef object obj3 = f()
Is there a way to store the various objects in an array instead of using several variables? Something along the lines of:
cdef void g(unsigned n):
cdef object[N_MAX] obj
for i in range(n)
obj[i] = f()