[NumPy-Tickets] [NumPy] #1393: assignment of float to int array causes loss of decimal part
NumPy Trac
numpy-tickets@scipy....
Tue Feb 9 07:40:19 CST 2010
#1393: assignment of float to int array causes loss of decimal part
-------------------------+--------------------------------------------------
Reporter: lebigot | Owner: somebody
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Other | Version: devel
Keywords: |
-------------------------+--------------------------------------------------
An assignment such as
{{{
my_array[0] = 5.4
}}}
does not produce a warning when my_array is an array of integers.
This is different from what
{{{
my_array[0] = 5.4j
}}}
does when assigning to an array of floats: a warning is issued, in this
case (which I think is very much appropriate, as "explicit is better than
implicit").
It would be better if both behaviors were consistent with each other
(issue a warning or not, for both complex in float array, and float in
integer array). And I second issuing a warning, to be consistent with
"import this". :)
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1393>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list