[Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

Andrew Collette andrew.collette at gmail.com
Tue Jan 8 12:20:53 EST 2013


Hi,

> I think you are voting strongly for the current casting rules, because
> they make it less obvious to the user that scalars are different from
> arrays.

Maybe this is the source of my confusion... why should scalars be
different from arrays?  They should follow the same rules, as closely
as possible.  If a scalar value would fit in an int16, why not add it
using the rules for an int16 array?

> Returning to the question of 1.5 behavior vs the error - I think you
> are saying you prefer the 1.5 silent-but-deadly approach to the error,
> but I think I still haven't grasped why.  Maybe someone else can
> explain it?  The holiday has not been good to my brain.

In a strict choice between 1.5-behavior and errors, I'm not sure which
one I would pick.  I don't think either is particularly useful.  Of
course, other members of the community would likely have a different
view, especially those who got used to the 1.5 behavior.

Andrew



More information about the NumPy-Discussion mailing list