Closed
Description
An error should occur when returning a non-integer value from index.
Expected result (cpython)
>>> class C:
... def __index__(self):
... return 'a'
...
>>> c = C()
>>> a = [1, 2 ,4]
>>> a[c]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __index__ returned non-int (type str)
Actual result (gpython)
>>> class C:
... def __index__(self):
... return 'a'
...
>>> c = C()
>>> a = [1, 2, 4]
>>> a[c]
1