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.

Author Spencer Brown
Recipients Spencer Brown, aroberge, miguendes, mishra.akash.myself, pablogsal, remi.lapeyre, serhiy.storchaka
Date 2021-12-05.20:35:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638736528.04.0.22354708558.issue44166@roundup.psfhosted.org>
In-reply-to
Content
One potential solution would be to add two Py_ssize_t to IndexError, storing the index and length along with the existing exception value. Then __str__() can append that to the message if set, perhaps having len be negative to signal they're not passed. 

An issue though is that it might be backwards incompatible with classes trying to multiply inherit from other exceptions too. To deal with that it could put the values in the args tuple, though then it'd have to allocate the tuple and ints which might hurt perf.
History
Date User Action Args
2021-12-05 20:35:28Spencer Brownsetrecipients: + Spencer Brown, aroberge, serhiy.storchaka, pablogsal, remi.lapeyre, miguendes, mishra.akash.myself
2021-12-05 20:35:28Spencer Brownsetmessageid: <1638736528.04.0.22354708558.issue44166@roundup.psfhosted.org>
2021-12-05 20:35:28Spencer Brownlinkissue44166 messages
2021-12-05 20:35:27Spencer Browncreate