New submission from Oscar <tuxs...@gmail.com>:

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

----------
messages: 361016
nosy: tuxskar
priority: normal
severity: normal
status: open
title: ValueError using index on tuple is not showing the tuple value
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39499>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to