[Numpy-tickets] [NumPy] #761: operator += fails silently when adding arrays with diffenent base types

NumPy numpy-tickets@scipy....
Sun Apr 27 03:39:54 CDT 2008


#761: operator += fails silently when adding arrays with diffenent base types
----------------------------+-----------------------------------------------
 Reporter:  drevicko        |       Owner:  somebody                    
     Type:  defect          |      Status:  new                         
 Priority:  normal          |   Milestone:  1.2                         
Component:  numpy.numarray  |     Version:  none                        
 Severity:  normal          |    Keywords:  upcast upcasting += operator
----------------------------+-----------------------------------------------
 Example:
 {{{
 >>> a=array([1,2,3])
 >>> b=array([4,5,6])
 >>> b+=a
 >>> b    # b and a are both integer arrays and += succeeds as expected
 array([5, 7, 9])
 >>> b+=0.1*a
 >>> b    # b and integer array, 0.1*a a float array : += failed silently
 array([5, 7, 9])
 >>> b=b+0.1*a
 >>> b    # works when written longhand.
 array([ 5.1,  7.2,  9.3])
 >>>
 }}}

 I have numpy version 1.04 (this is not in the trac version list...)
 Python 2.5.2 on win32

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/761>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list