[issue39499] ValueError using index on tuple is not showing the tuple value

2020-01-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is a duplicate of issue33560. See also issue13349 which is the original 
duplicate.

--
nosy: +xtreak
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Non-informative error message in index() and remove() functions
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39499] ValueError using index on tuple is not showing the tuple value

2020-01-29 Thread Oscar


New submission from Oscar :

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 "", line 1, in 
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 "", line 1, in 
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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com