[Numpy-tickets] [NumPy] #375: Numpy.arange() gives confusing error message

NumPy numpy-tickets at scipy.net
Wed Nov 8 03:56:52 CST 2006

#375: Numpy.arange() gives confusing error message
 Reporter:  gpk2    |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  low     |   Milestone:          
Component:  Other   |     Version:          
 Severity:  minor   |    Keywords:          
 if x is a Numpy array, then

 Num.arange(x.shape) reports
 TypeError: unsupported operand type(s) for -: 'tuple' and 'int'
 This is confusing.    What it should report is
 that arange needs integer argument(s), rather than a tuple.
 Normally, this would not be a big deal, but it's a very easy
 error to make, and one that is not particularly easy
 to see when one is debugging.

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

More information about the Numpy-tickets mailing list