[ACCEPTED]-How to use const in Cython-cython
Accepted answer
const
works for function arguments, but not for 5 this construct because of how Cython compiles 4 it to C.
cdef double a = 2.5
becomes
double __pyx_v_a;
/* lots of other declarations */
__pyx_v_a = 2.5;
and this wouldn't work with 3 a const
variable. In effect, you cannot use const
in 2 Cython in all the places were you can use 1 it in C.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.