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 tuxskar
Recipients tuxskar
Date 2020-01-30.07:41:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580370108.47.0.271074829024.issue39499@roundup.psfhosted.org>
In-reply-to
Content
When trying to retrieve the index of an element that is not in a tuple the error message of ValueError is not showing the value looking for but instead a static message tuple.index(x): x not in tuple

>>> b = (1, 2, 3, 4)
>>> b.index(5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: tuple.index(x): x not in tuple

I would expect something like what happen in lists where the element (5 in this case) is showed on the ValueError.
>>> a = [1, 2, 3, 4]
>>> a.index(5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: 5 is not in list
History
Date User Action Args
2020-01-30 07:41:48tuxskarsetrecipients: + tuxskar
2020-01-30 07:41:48tuxskarsetmessageid: <1580370108.47.0.271074829024.issue39499@roundup.psfhosted.org>
2020-01-30 07:41:48tuxskarlinkissue39499 messages
2020-01-30 07:41:48tuxskarcreate