c doesn't do bounds check. So how does cython do the check if it compiles to c?
%%cython --annotate
cimport cython
@cython.boundscheck(True)
cpdef myf():
cdef double pd[8]
for i in range(100):
pd[i] = 0
print pd[i]
The above code compiles to the same C code no matter whether I set True
or False
for boundscheck
. And if I run myf()
there is no warnings (it happens to not crash...).
Update
So cython doens't do bounds check on c arrays anyway.