Message294631
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 |
|
Date |
User |
Action |
Args |
2017-05-28 08:21:48 | serhiy.storchaka | set | recipients:
+ 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:48 | serhiy.storchaka | set | messageid: <1495959708.81.0.390794144141.issue13349@psf.upfronthosting.co.za> |
2017-05-28 08:21:48 | serhiy.storchaka | link | issue13349 messages |
2017-05-28 08:21:48 | serhiy.storchaka | create | |
|