>> On Fri, Jun 1, 2012 at 10:46 AM, Chris Withers <ch...@simplistix.co.uk>

>> > 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
>>
>> Only that no-one has implemented it, I guess. If you want to then
>> that'd be cool :-).

That would be nice, but to be fair, python itself doesn't do it either:

>>> l = range(10)
>>> l[12]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: list index out of range

Though Python's standard error messages are lacking in a lot of places...

-Chris


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to