Bug report
Bug description:
Setting int to range.index() gets the clear error message as shown below:
v = range(5)
print(*v)
# 0 1 2 3 4
print(v.index(7))
# Error
ValueError: 7 is not in range
But setting other types than int to range.index() gets the less clear different error messages as shown below:
v = range(5)
print(*v)
# 0 1 2 3 4
print(v.index(7.5))
print(v.index(7.5+0.0j))
print(v.index('A'))
# Error
ValueError: sequence.index(x): x not in sequence
So they should also be as shown below:
ValueError: 7.5 is not in range
ValueError: 7.5+0.0j is not in range
ValueError: 'A' is not in range
CPython versions tested on:
3.12
Operating systems tested on:
Windows