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 2019年03月26日 17:11 by HardikPatel, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg338906 - (view) | Author: Hardik (HardikPatel) | Date: 2019年03月26日 17:11 | |
I am curious why ValueErrors are different in List and Tuple when I try to get an index. ValueError of a list returns in well format with actual argument "ValueError: 'ITEM' is not in list", whereas tuple returns something like this "ValueError: tuple.index(x): x not in tuple".
I think List and Tuple both are calling same index() method then why it is raising different ValueErrors?
>>> jframe_li
['Angular', 'React', 'Vue.js', 'Ember.js', 'Mereor', 'Node.js', 'Backbone.js']
>>> jframe_tu
('Angular', 'React', 'Vue.js', 'Ember.js', 'Mereor', 'Node.js', 'Backbone.js')
>>> jframe_li.index('React')
1
>>> jframe_tu.index('React')
1
>>> jframe_li.index('react')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: 'react' is not in list
>>> jframe_tu.index('react')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: tuple.index(x): x not in tuple
|
|||
| msg338910 - (view) | Author: SilentGhost (SilentGhost) * (Python triager) | Date: 2019年03月26日 18:22 | |
This seems to be related to argument clinic work (issue 20186 and issue 20185). |
|||
| msg339262 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2019年03月31日 15:57 | |
Thus is definitely is not related to Argument Clinic. And seems that this issue is a duplicate of an old issue with a long discussion and an unfinished patch, but currently I cannot find that issue. |
|||
| msg339267 - (view) | Author: Karthikeyan Singaravelan (xtreak) * (Python committer) | Date: 2019年03月31日 16:31 | |
> And seems that this issue is a duplicate of an old issue with a long discussion and an unfinished patch, but currently I cannot find that issue. possibly duplicate of issue13349 which was rejected ? |
|||
| msg339270 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2019年03月31日 17:10 | |
Yes, it is. Thank you Karthikeyan! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:13 | admin | set | github: 80623 |
| 2019年03月31日 17:10:26 | serhiy.storchaka | set | status: open -> closed superseder: Non-informative error message in index() and remove() functions messages: + msg339270 resolution: duplicate stage: resolved |
| 2019年03月31日 16:31:33 | xtreak | set | nosy:
+ xtreak messages: + msg339267 |
| 2019年03月31日 15:57:51 | serhiy.storchaka | set | type: behavior -> enhancement messages: + msg339262 components: - Argument Clinic versions: + Python 3.8, - Python 3.7 |
| 2019年03月26日 18:22:56 | SilentGhost | set | nosy:
+ SilentGhost, larry messages: + msg338910 components: + Argument Clinic |
| 2019年03月26日 18:18:55 | SilentGhost | set | nosy:
+ serhiy.storchaka components: + Interpreter Core, - Tests |
| 2019年03月26日 17:11:24 | HardikPatel | create | |