Why not just show the out-of-range index?

John Machin sjmachin at lexicon.net
Sun Dec 3 20:02:51 EST 2006


James Stroud wrote:
> Russ wrote:
> > Every Python programmer gets this message occasionally:
> >
> > IndexError: list index out of range
> >
> > The message tells you where the error occurred, but it doesn't tell you
> > what the range and the offending index are. Why does it force you to
> > determine that information for yourself when it could save you a step
> > and just tell you? This seems like a "no-brainer" to me. Am I missing
> > something?
> >
>
> I think you have a point. I am curious to see how far people are willing
> to go to defend this omission. It promises to be entertaining.
> 

Add "Syntax Error: invalid syntax" to the list ...




More information about the Python-list mailing list