This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: display index on IndexError
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.8
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Add index attribute to IndexError
View: 18162
Assigned To: Nosy List: Aditya Shankar, xtreak
Priority: normal Keywords:

Created on 2019-03-05 16:54 by Aditya Shankar, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg337231 - (view) Author: Aditya Shankar (Aditya Shankar) Date: 2019-03-05 17:00
considering a list of 5 elements, if the 6th element is asked, the Interpreter would raise IndexError: list index out of range,
I think It'd be better if it actually said what the invalid index is

Improvement benefits:
*quicker debugging of faulty python code
*person debugging does not need to edit and restart the program to fix issue, sometimes at least
msg337232 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-03-05 17:27
Possibly related issues in the past : 
issue18162, issue1534607 , issue21911, https://www.python.org/dev/peps/pep-0473/
msg337233 - (view) Author: Aditya Shankar (Aditya Shankar) Date: 2019-03-05 17:33
closed as this is a duplicate for https://bugs.python.org/issue18162
History
Date User Action Args
2022-04-11 14:59:12adminsetgithub: 80381
2019-03-05 17:38:00SilentGhostsetsuperseder: Add index attribute to IndexError
resolution: duplicate
2019-03-05 17:33:15Aditya Shankarsetstatus: open -> closed

messages: + msg337233
stage: resolved
2019-03-05 17:27:47xtreaksetnosy: + xtreak
messages: + msg337232
2019-03-05 17:00:44Aditya Shankarsetmessages: + msg337231
2019-03-05 16:56:35Aditya Shankarsetversions: + Python 3.8
type: enhancement
components: + Interpreter Core
title: display index on Index -> display index on IndexError
2019-03-05 16:54:42Aditya Shankarcreate