How can I create and return an array of extensions in cython?

96 Views Asked by At

I want to create a function, which creates a 2d array of cdef class

cdef PyObject* create():
    cdef PyObject* cells[2][2]
    cdef Cell cell
    for i in range(2):
        for j in range(2):
            cell = Cell(i, j)# def class Cell: ...
            cells[i][j] = <PyObject*>cell
    return cells

Error during compilation: Cannot assign type 'PyObject *[2][2]' to 'PyObject *'

What is the proper way to return the array?

0

There are 0 best solutions below