How to define an initialized C-array in Pyrex?

I want to define an initialized C array in Pyrex, for example. equivalent:

unsigned char a[8] = {0,1,2,3,4,5,6,7};

What will be equivalent in Pyrex?

Just an array

cdef unsigned char a[8]

But how can I initialize my values?

+3
source share
1 answer

In Cython , the successor to Pyrex, this feature was added a year later to fix this , for example, the following now works in Cython:

cdef double a[] = [0.5, 0.3, 0.1, 0.1]

, Pyrex ( Cython rarin ), , ( , Pyrex, 0.9.8.6).

Pyrex , Cython? Pyrex Cython, .

+4

Source: https://habr.com/ru/post/1736984/


All Articles