Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
The problem is that such exceptions are often used with the EAFP style. For example: while stop is None or i < stop: try: v = self[i] if v is value or v == value: return i except IndexError: break i += 1 You caught IndexError and do something, but do not use the error message. Formatting error message takes a time. I am sure that error messages of a wast majority of IndexError exceptions are not used, just the type of the raised exception matters. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44166> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com