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

Andrew Collette andrew.collette at gmail.com
Mon Jan 7 16:18:52 EST 2013


Hi Matthew,

> In this case I think you'd probably agree it would be reasonable to
> raise an error - all other things being equal?

No, I don't agree.  I want there to be some default semantics I can
rely on.  Preferably, I want it to do the same thing it would do if
some_offset were an array with element-by-element offsets, which is
the current behavior of numpy 1.6 if you assume a reasonable dtype for
some_offset.

> Can you think of another practical case where it would be reasonably
> clear that it was the wrong thing to do?

I consider "myarray + constant -> Error" clearly wrong no matter what
the context.  I've never seen it in any other analysis language I've
used.  But it's also possible that I'm alone in this... I haven't seen
many other people here arguing against the change.

Andrew



More information about the NumPy-Discussion mailing list