[Numpy-discussion] better error message possible?

Chris Withers chris at simplistix.co.uk
Fri Jun 1 05:46:07 EDT 2012


Hi All,

Any reason why this:

 >>> import numpy
 >>> numpy.zeros(10)[-123]
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
IndexError: index out of bounds

...could say this:

 >>> numpy.zeros(10)[-123]
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
IndexError: -123 is out of bounds

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk



More information about the NumPy-Discussion mailing list