vs-code-cython icon indicating copy to clipboard operation
vs-code-cython copied to clipboard

Error: Axis specification only allowed in the "step" slot for memory view Cython

Open mgnshmpl opened this issue 6 months ago • 0 comments

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.

mgnshmpl avatar Aug 09 '24 10:08 mgnshmpl