Serhiy Storchaka added the comment:

__index__() is used because float has __int__ but not __index__.

>>> (42.0).__int__()
42
>>> (42.0).__index__()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'float' object has no attribute '__index__'

----------
nosy: +mark.dickinson, serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to