[issue35707] time.sleep() should support objects with __float__

Jeroen Demeyer report at bugs.python.org
Mon Jan 21 05:48:34 EST 2019


Jeroen Demeyer <J.Demeyer at 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 <report at bugs.python.org>
<https://bugs.python.org/issue35707>
_______________________________________


More information about the Python-bugs-list mailing list