[Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Francesc Alted
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. Which one would you

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Charles R Harris
On Tue, Jul 27, 2010 at 7:08 AM, Francesc Alted fal...@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,

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Francesc Alted
A Tuesday 27 July 2010 15:20:47 Charles R Harris escrigué: On Tue, Jul 27, 2010 at 7:08 AM, Francesc Alted fal...@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

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Dag Sverre Seljebotn
Francesc Alted wrote: A Tuesday 27 July 2010 15:20:47 Charles R Harris escrigué: On Tue, Jul 27, 2010 at 7:08 AM, Francesc Alted fal...@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`

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Kurt Smith
On Tue, Jul 27, 2010 at 9:45 AM, Francesc Alted fal...@pytables.org wrote: A Tuesday 27 July 2010 15:20:47 Charles R Harris escrigué: On Tue, Jul 27, 2010 at 7:08 AM, Francesc Alted fal...@pytables.org wrote: Hi, I'm a bit confused on which datatype should I use when referring to NumPy

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Francesc Alted
A Tuesday 27 July 2010 17:17:55 Dag Sverre Seljebotn escrigué: Kurt Smith wrote: Looking at the bufferinfo struct for the buffer protocol, it uses `Py_ssize_t`: struct bufferinfo { void *buf; Py_ssize_t len; int readonly; const char *format; int ndim;

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread Kurt Smith
On Tue, Jul 27, 2010 at 10:17 AM, Dag Sverre Seljebotn da...@student.matnat.uio.no wrote:  From PEP 353:    Why not size_t56 http://www.python.org/dev/peps/pep-0353/#id9 An initial attempt to implement this feature tried to use size_t. It quickly turned out that this cannot work: Python

Re: [Numpy-discussion] size_t or npy_intp?

2010-07-27 Thread David Cournapeau
On Tue, Jul 27, 2010 at 10:08 PM, Francesc Alted fal...@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,