homepage

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.

Author HardikPatel
Recipients HardikPatel
Date 2019年03月26日.17:11:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553620284.92.0.688954440948.issue36442@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019年03月26日 17:11:24HardikPatelsetrecipients: + HardikPatel
2019年03月26日 17:11:24HardikPatelsetmessageid: <1553620284.92.0.688954440948.issue36442@roundup.psfhosted.org>
2019年03月26日 17:11:24HardikPatellinkissue36442 messages
2019年03月26日 17:11:24HardikPatelcreate

AltStyle によって変換されたページ (->オリジナル) /