[Numpy-discussion] Possible bug in PyArray_RemoveSmallest?

Albert Strasheim fullung@gmail....
Thu Mar 15 05:11:15 CDT 2007

Hello all

I was poking around in the NumPy internals and I came across the 
following code in PyArray_RemoveSmallest in arrayobject.c:

intp sumstrides[NPY_MAXDIMS];


for (i=0; i<multi->nd; i++) {
    sumstrides[i] = 0;
    for (j=0; j<multi->numiter; j++) {
        sumstrides[i] = multi->iters[j]->strides[i];

This might be a red herring, but from the name of the variable 
(sumstrides) and the code (iterating over a bunch of strides) I'm 
guessing the author might have intended to write:

sumstrides[i] += multi->iters[j]->strides[i];



More information about the Numpy-discussion mailing list