Message294631
| 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: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 |
|