[Numpy-discussion] ufunc oddities

Charles R Harris charlesr.harris at gmail.com
Sun May 25 00:00:49 EDT 2008


On Sat, May 24, 2008 at 9:50 PM, Nathan Bell <wnbell at gmail.com> wrote:

> On Sat, May 24, 2008 at 10:40 PM, Charles R Harris
> <charlesr.harris at gmail.com> wrote:
> >
> > The question is consistency. A programmer should just have to remember a
> few
> > simple rules, not a host of special cases. It makes things easier to
> learn
> > and the code easier to understand because the intent is always made
> clear.
> > Designing to whatever happens to be convenient at the moment leads to a
> mess
> > and trying to document all the oddities is a PITA.
> >
>
> Sometimes "do what I expect" is better than rigid consistency.  I
> would argue that avoiding common overflow cases is more important than
> preserving the dtype when summing.
>
> Anyway, the point is moot.  There's no way to change x.sum() without
> breaking lots of code.
>

Certainly, and the change to the default accumulator was made to avoid the
common expectation of no wraparound. But it is time to document these things
and write tests, and the tests will engrave the current behavior in stone.
Which is why we need to be sure that the current behavior is in fact correct
and not an overlooked booboo.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080524/d44bd53c/attachment.html>


More information about the NumPy-Discussion mailing list