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

Jeroen Demeyer report at bugs.python.org
Sun Aug 4 16:47:29 EDT 2019


Jeroen Demeyer <J.Demeyer at UGent.be> added the comment:

> If we want to support other numerical types with loss in double rounding, the most reliable way is to represent them as fractions (x.as_integer_ratio() or (x.numerator, x.denominator))

See https://discuss.python.org/t/pep-3141-ratio-instead-of-numerator-denominator/2037/24?u=jdemeyer for a proposal to define __ratio__ for this.

----------

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


More information about the Python-bugs-list mailing list