[Numpy-discussion] size_t or npy_intp?

Charles R Harris charlesr.harris@gmail....
Tue Jul 27 08:20:47 CDT 2010

On Tue, Jul 27, 2010 at 7:08 AM, Francesc Alted <faltet@pytables.org> wrote:

> Hi,
> I'm a bit confused on which datatype should I use when referring to NumPy
> ndarray lengths.  In one hand I'd use `size_t` that is the canonical way to
> refer to lengths of memory blocks.  In the other hand, `npy_intp` seems the
> standard data type used in NumPy for this.
They have different ranges, npy_intp is signed and in later versions of
Python is the same as Py_ssize_t, while size_t is unsigned. It would be a
bad idea to mix the two.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100727/f56e83cc/attachment.html 

More information about the NumPy-Discussion mailing list