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

> the most reliable way is to represent them as fractions (x.as_integer_ratio() 
> or (x.numerator, x.denominator))

I don't think that we can rely on non-dunder names like that. They are not 
reserved names, so classes can give them any semantics that they like. This is 
not just hypothetical: SageMath for example uses numerator() and denominator() 
methods, not properties.

If you really want to go through with this, probably a special method like 
__as_integer_ratio__ should be defined.

Anyway, I personally consider the double rounding for time.sleep() a non-issue. 
We are not trying to write a precise math library here, nobody will complain 
about sleeping a femtosecond too long.

----------

_______________________________________
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