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

Ronald Oussoren report at bugs.python.org
Mon Jan 21 08:27:13 EST 2019


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

> In other words: if we can only use __float__ and __int__, how do we know which one to use?

I guess __index__. I've read the definition of object.__index__ in the data model documentation, and using __index__ for this conversion is fine. I need to educate my sense for when it's right to use this method...

Sorry about the noise.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35707>
_______________________________________


More information about the Python-bugs-list mailing list