[NumPy-Tickets] [NumPy] #2061: difference between behavior of assignment division and future division not documented

NumPy Trac numpy-tickets@scipy....
Wed Feb 22 11:43:51 CST 2012


#2061: difference between behavior of assignment division and future division not
documented
----------------------------+-----------------------------------------------
  Reporter:  AlanFrankel    |       Owner:  pv                           
      Type:  defect         |      Status:  closed                       
  Priority:  normal         |   Milestone:  Unscheduled                  
 Component:  Documentation  |     Version:  1.6.1                        
Resolution:  invalid        |    Keywords:  assignment division operators
----------------------------+-----------------------------------------------

Comment(by mwiebe):

 To add my opinion here: I want this case to raise an exception by default
 based on the 'same_kind' casting rule. e.g.

 {{{
 >>> a = np.array([1,2,3,4])
 >>> a /= 1.5
 >>> a
 array([0, 1, 2, 2])
 >>> np.divide(a, 1.5, out=a, casting='same_kind')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: ufunc 'divide' output (typecode 'd') could not be coerced to
 provided output parameter (typecode 'l') according to the casting rule
 'same_kind'
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2061#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list