vs-code-cython
vs-code-cython copied to clipboard
Error: Axis specification only allowed in the "step" slot for memory view Cython
The following code
from cpython.mem cimport PyMem_Malloc
cdef int N = 3
cdef float complex *arr_ptr = <float complex *> PyMem_Malloc(N * N * sizeof(float complex))
cdef float complex[:, ::1] arr = <float complex[:N, :N]> arr_ptr
compiles and works as intended. However, my linter marks the two :N in the typecast in the last line with the error message in the title. As far as I know, my way of initializing the view should be fine.