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.

Author jdemeyer
Recipients jdemeyer, mark.dickinson, rhettinger, serhiy.storchaka, steven.daprano
Date 2019-08-23.19:53:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566590039.02.0.471164394746.issue37884@roundup.psfhosted.org>
In-reply-to
Content
> FWIW, the entire point of us having recently added as_integer_ratio() methods to so many concrete classes is to avoid the need for helper functions in favor of a simple try/except around a single call.

But what about PEP 3141? The fractions.Fraction constructor accepts numbers.Rational instances, which do not necessarily have an as_integer_ratio() method. We can't just drop support for that (*). So in practice you do need to check both as_integer_ratio() and the PEP 3141 numerator/denominator properties. It seems useful to have a helper function for this.

(*) Unless you want to deprecate PEP 3141. This may be less crazy than it sounds, especially given Guido van Rossum's reaction on https://discuss.python.org/t/pep-3141-ratio-instead-of-numerator-denominator/2037/25?u=jdemeyer
History
Date User Action Args
2019-08-23 19:53:59jdemeyersetrecipients: + jdemeyer, rhettinger, mark.dickinson, steven.daprano, serhiy.storchaka
2019-08-23 19:53:59jdemeyersetmessageid: <1566590039.02.0.471164394746.issue37884@roundup.psfhosted.org>
2019-08-23 19:53:59jdemeyerlinkissue37884 messages
2019-08-23 19:53:58jdemeyercreate