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

James Stroud jstroud at mbi.ucla.edu
Sun Dec 3 19:55:21 EST 2006


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.

James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list