KEMBAR78
tuple.index vs list.index different value errors · Issue #121288 · python/cpython · GitHub
Skip to content

tuple.index vs list.index different value errors #121288

@xSpecialFoodx

Description

@xSpecialFoodx

Bug report

Bug description:

().index(0)  # outputs "tuple.index(x): x not in tuple"
[].index(0)  # outputs "0 is not in list"

i think it'd be useful to normalize them to have the same value error, in tuple you can see that the item's value or name isn't even mentioned, unlike in list that the item's value is mentioned, although the name is not.

CPython versions tested on:

3.11

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions