Skip to content

ValueError exception of tuple.index(x) gives imprecise error message #49745

Closed

Description

@Retro
mannequin
BPO 5495
Nosy @vstinner, @benjaminp
Files
  • not_in_tuple.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-03-15.14:39:10.095>
    created_at = <Date 2009-03-15.14:30:34.632>
    labels = []
    title = 'ValueError exception of tuple.index(x) gives imprecise error message'
    updated_at = <Date 2009-03-15.14:39:10.086>
    user = 'https://bugs.python.org/Retro'

    bugs.python.org fields:

    activity = <Date 2009-03-15.14:39:10.086>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-03-15.14:39:10.095>
    closer = 'benjamin.peterson'
    components = ['None']
    creation = <Date 2009-03-15.14:30:34.632>
    creator = 'Retro'
    dependencies = []
    files = ['13339']
    hgrepos = []
    issue_num = 5495
    keywords = ['patch']
    message_count = 3.0
    messages = ['83633', '83634', '83635']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'benjamin.peterson', 'Retro']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue5495'
    versions = ['Python 3.1']

    Activity

    1. Retro commented on Mar 15, 2009

      Retromannequin
      MannequinAuthor
      >>> 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.

    2. vstinner commented on Mar 15, 2009

      @vstinner
      Member

      Attached patch fixes the error message.

    3. benjaminp commented on Mar 15, 2009

      @benjaminp
      Contributor

      Fixed in r70385.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions