[issue5353] Improve IndexError messages with actual values

R. David Murray report at bugs.python.org
Tue Mar 17 14:47:29 CET 2009


R. David Murray <rdmurray at bitdance.com> added the comment:

This issue was discussed two years ago in this thread:

http://mail.python.org/pipermail/python-list/2006-December/588224.html

Most of the messages under that subject are noise about politeness or
lack thereof (including a post by the submitter of this issue trying to
get people to be reasonable!), but an actual patch was posted as well:

http://mail.python.org/pipermail/python-list/2006-December/588377.html

The patch addresses only one object type, but does demonstrate a pattern
that might be usable in general.  A concern was raised about the
generality of the function proposed, as well as the performance
implications of calling it.

I have not tried to apply the patch to the current trunk, but from a
quick look it doesn't seem like the source has changed much.  Since the
problem turns out to be a lot less trivial than it seems like it should
be, the patch is a good reference in any case.

----------
nosy: +bitdancer

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5353>
_______________________________________


More information about the Python-bugs-list mailing list