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.
Created on 2018年05月17日 16:20 by Cyril Roelandt, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 6944 | closed | python-dev, 2018年05月17日 16:35 | |
| Messages (2) | |||
|---|---|---|---|
| msg316955 - (view) | Author: Cyril Roelandt (Cyril Roelandt) * | Date: 2018年05月17日 16:20 | |
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(). |
|||
| msg316964 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2018年05月17日 16:47 | |
This is a duplicate of issue13349. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:00 | admin | set | github: 77741 |
| 2018年05月17日 16:47:25 | serhiy.storchaka | set | status: open -> closed superseder: Non-informative error message in index() and remove() functions nosy: + serhiy.storchaka messages: + msg316964 resolution: fixed stage: patch review -> resolved |
| 2018年05月17日 16:35:46 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request6612 |
| 2018年05月17日 16:20:20 | Cyril Roelandt | create | |