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

mensanator at aol.com mensanator at aol.com
Sun Dec 3 21:07:16 EST 2006


John Machin wrote:
> 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 ...

But at least if you're using IDLE, the point of syntax error
is highlighted.

When I was a programmer, I thought as a programmer,
I spake as a programmer and I understood as a programmer.
But when I became a User, I put away such childish things.




More information about the Python-list mailing list