Petri Lehtinen <pe...@digip.org> added the comment: The good thing about this is ease of debugging. You can see which is the offending value that was not found.
On the other hand, the repr of a value might be very long: >>> [].index(list(range(1000))) ValueError: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... (many lines of numbers) 997, 998, 999] is not in list Also, all values don't have a very informal repr: >>> class Foo: pass ... >>> [].index(Foo()) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: <__main__.Foo object at 0xb736f92c> is not in list ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13349> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com