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.

classification
Title: ValueError exception of tuple.index(x) gives imprecise error message
Type: Stage:
Components: None Versions: Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Retro, benjamin.peterson, vstinner
Priority: normal Keywords: patch

Created on 2009-03-15 14:30 by Retro, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
not_in_tuple.patch vstinner, 2009-03-15 14:33
Messages (3)
msg83633 - (view) Author: Boštjan Mejak (Retro) Date: 2009-03-15 14:30
>>> t = (0, 1, 2, 3, 4, 5, 6, 7)
>>> t.index(8)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: tuple.index(x): x not in list

The error message "x not in list" should have been "x not in tuple".
Please fix the error message of the index method of the tuple type.
msg83634 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-03-15 14:33
Attached patch fixes the error message.
msg83635 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-15 14:39
Fixed in r70385.
History
Date User Action Args
2022-04-11 14:56:46adminsetgithub: 49745
2009-03-15 14:39:10benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg83635

resolution: fixed
2009-03-15 14:33:33vstinnersetfiles: + not_in_tuple.patch

nosy: + vstinner
messages: + msg83634

keywords: + patch
2009-03-15 14:30:34Retrocreate