Message316955
| Author |
Cyril Roelandt |
| Recipients |
Cyril Roelandt |
| Date |
2018年05月17日.16:20:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1526574020.28.0.682650639539.issue33560@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The tuple.index() method returns an error message that does not allow users to know what element was being looked for inside the tuple:
>>> ().index(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: tuple.index(x): x not in tuple
The list.index() method has a much better error message:
>>> [].index(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: 1 is not in list
We could improve tuple.index() so that its behaviour becomes similar to that of list.index(). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年05月17日 16:20:20 | Cyril Roelandt | set | recipients:
+ Cyril Roelandt |
| 2018年05月17日 16:20:20 | Cyril Roelandt | set | messageid: <1526574020.28.0.682650639539.issue33560@psf.upfronthosting.co.za> |
| 2018年05月17日 16:20:20 | Cyril Roelandt | link | issue33560 messages |
| 2018年05月17日 16:20:20 | Cyril Roelandt | create |
|