I was reading:  http://wiki.cython.org/tutorials/numpy

and I am confused on the difference between:

A)

cimport numpy as np
cdef np.ndarray h = np.zeros([xmax, ymax], dtype=DTYPE)

and

B)

cimport numpy as np
cdef np.ndarray[DTYPE_t, ndim=2] h =np.zeros([xmax, ymax], dtype=DTYPE)


In particular, I guess I don't understand what is gained by using A.
I had thought that the cimport of numpy and the cdef h would be enough
to give significant benefits.  From the article, I understand what B
improves upon over A, but what does A give us in the first place?
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to