[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is a duplicate of issue13349.

--
nosy: +serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
superseder:  -> Non-informative error message in index() and remove() functions

___
Python tracker 

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



[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +6612
stage:  -> patch review

___
Python tracker 

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



[issue33560] tuple.index() could return a more explicit error message

2018-05-17 Thread Cyril Roelandt

New submission from Cyril Roelandt :

The tuple.index() method returns an error message that does not allow users to 
know what element was being looked for inside the tuple:

>>> ().index(1)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: tuple.index(x): x not in tuple

The list.index() method has a much better error message:

>>> [].index(1)   
Traceback (most recent call last):
  File "", line 1, in 
ValueError: 1 is not in list

We could improve tuple.index() so that its behaviour becomes similar to that of 
list.index().

--
messages: 316955
nosy: Cyril Roelandt
priority: normal
severity: normal
status: open
title: tuple.index() could return a more explicit error message
type: enhancement
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