Jeroen Demeyer <j.deme...@ugent.be> added the comment:

The motivation for PEP 357 was certainly using an object as the index for a 
sequence, but that's not the only use case.

In fact PEP 357 states "For example, the slot can be used any time Python 
requires an integer internally"

So despite the name __index__, I think that this is now the de facto standard 
for "convert the object (which is some kind of integer) to a Python int without 
loss of precision".

----------

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

Reply via email to