This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 jdemeyer
收信人 AVINASH MISHRA, jdemeyer, ncoghlan, remi.lapeyre, serhiy.storchaka, vstinner
日期 2019-01-13.12:39:24
SpamBayes Score -1.0
Marked as misclassified
Message-id <1547383164.75.0.931794701207.issue35707@roundup.psfhosted.org>
In-reply-to
内容
> 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.
历史
日期 用户 动作 参数
2019-01-13 12:39:26jdemeyer修改recipients: + jdemeyer, ncoghlan, vstinner, serhiy.storchaka, remi.lapeyre, AVINASH MISHRA
2019-01-13 12:39:24jdemeyer修改messageid: <1547383164.75.0.931794701207.issue35707@roundup.psfhosted.org>
2019-01-13 12:39:24jdemeyer链接issue35707 messages
2019-01-13 12:39:24jdemeyer创建