- Notifications
You must be signed in to change notification settings - Fork 98
Closed
Labels
Description
An error should occur when returning a non-integer value from index.
Expected result (cpython)
>>>classC: ... def__index__(self): ... return'a' ... >>>c=C() >>>a= [1, 2 ,4] >>>a[c] Traceback (mostrecentcalllast): File"<stdin>", line1, in<module>TypeError: __index__returnednon-int (typestr)Actual result (gpython)
>>>classC: ... def__index__(self): ... return'a' ... >>>c=C() >>>a= [1, 2, 4] >>>a[c] 1