[Numpy-discussion] Casting Bug or a "Feature"?

Nathaniel Smith njs at pobox.com
Wed Jan 16 20:24:19 EST 2013


This is separate from the scalar casting thing. This is a disguised version
of the discussion about what we should do with implicit casts caused by
assignment:
  into_array[i] = 0.5

Traditionally numpy just happily casts this stuff, possibly mangling data
in the process, and this has caused many actual bugs in user code. In 1.6
some of these assignments cause errors, but we reverted this in 1.7 because
this was also breaking things. Supposedly we also deprecated these at the
same time, with an eye towards making them errors eventually, but I'm not
sure we did this properly, and our carrying rules need revisiting in any
case.

(Sorry for lack of links to earlier discussion; traveling and on my phone.)

-n
On 16 Jan 2013 16:42, "Chris Barker - NOAA Federal" <chris.barker at noaa.gov>
wrote:

> Patrick,
>
> Not a bug but is it a mis-feature?
>
> See the recent thread: "Do we want scalar casting to behave as it does
> at the moment"
>
> In short, this is an complex issue with no easy answer...
>
> -Chris
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker at noaa.gov
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130117/3a1ed2a9/attachment.html>


More information about the NumPy-Discussion mailing list