<br><br><div class="gmail_quote">On Fri, Jun 1, 2012 at 10:56 AM, Chris Withers <span dir="ltr"><<a href="mailto:chris@simplistix.co.uk" target="_blank">chris@simplistix.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 01/06/2012 16:39, Benjamin Root wrote:<br>
><br>
><br>
>      > >>> import numpy<br>
>      > >>> numpy.zeros(10)[-123]<br>
>      > Traceback (most recent call last):<br>
>      >   File "<stdin>", line 1, in <module><br>
>      > IndexError: index out of bounds<br>
>      ><br>
>      > ...could say this:<br>
>      ><br>
>      > >>> numpy.zeros(10)[-123]<br>
>      > Traceback (most recent call last):<br>
>      >   File "<stdin>", line 1, in <module><br>
>      > IndexError: -123 is out of bounds<br>
><br>
>     Only that no-one has implemented it, I guess. If you want to then<br>
>     that'd be cool :-).<br>
><br>
>     To be generally useful for debugging, it would probably be good for<br>
>     the error message to also mention which dimension is involved, and/or<br>
>     the actual size of the array in that dimension. You can also get such<br>
>     error messages from expressions like 'arr[i, j, k]', after all, where<br>
>     it's even less obvious what went wrong.<br>
><br>
>     -- Nathaniel<br>
><br>
><br>
> +1, please!<br>
<br>
</div>Indeed, sadly I'm not a C developer. It's a pet bugbear of mine that<br>
Python's built-in exceptions often tell you what went wrong but not what<br>
data caused the error, even when it's easily to hand when raising the<br>
exception.<br>
<br>
Where's the right place to raise an issue that a numpy developer can<br>
hopefully make the (I suspect) simple change to get this behaviour?<br>
<div class="im HOEnZb"><br></div></blockquote><div><br>Hmm, how about I enable github issues for the numpy repository? It looks like we are headed that way and maybe now is a good time to get started.<br><br>Chuck <br></div>
</div>