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 serhiy.storchaka
Recipients Jim Fasarakis-Hilliard, Julian, Sean.Ochoa, brett.cannon, eamanu, eric.araujo, ezio.melotti, ncoghlan, petri.lehtinen, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2017-05-28.08:21:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495959708.81.0.390794144141.issue13349@psf.upfronthosting.co.za>
In-reply-to
Content
I concur with Raymond.

But shouldn't we change error messages that contains the repr of not found value? Affected collections are list, deque and range.

>>> [].index('spam')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 'spam' is not in list
>>> import collections
>>> collections.deque().index('spam')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 'spam' is not in deque

range.index() raises different error messages depending on the type of the value:

>>> range(10).index('spam')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: sequence.index(x): x not in sequence
>>> range(10).index(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 42 is not in range
History
Date User Action Args
2017-05-28 08:21:48serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, rhettinger, terry.reedy, ncoghlan, vstinner, ezio.melotti, eric.araujo, Julian, petri.lehtinen, Sean.Ochoa, Jim Fasarakis-Hilliard, eamanu
2017-05-28 08:21:48serhiy.storchakasetmessageid: <1495959708.81.0.390794144141.issue13349@psf.upfronthosting.co.za>
2017-05-28 08:21:48serhiy.storchakalinkissue13349 messages
2017-05-28 08:21:48serhiy.storchakacreate