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 serhiy.storchaka
Recipients jdemeyer, mark.dickinson, rhettinger, serhiy.storchaka, steven.daprano
Date 2019-08-24.10:09:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I'm with Raymond here; I don't think this change is desirable for the math module, either with or without the leading underscore in the name.

Could you please explain what is wrong in adding a helper function which will help to convert different types of numbers to integer ratio correctly?

Currently you need to write a complex code if you need to convert a general number to integer ratio:

        as_integer_ratio = x.as_integer_ratio
    except AttributeError:
        n = x.numerator
        d = x.denominator
        n, d = as_integer_ratio()

(and maybe even more complex if you want to add fast path for int).
Date User Action Args
2019-08-24 10:09:40serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, mark.dickinson, steven.daprano, jdemeyer
2019-08-24 10:09:40serhiy.storchakasetmessageid: <>
2019-08-24 10:09:40serhiy.storchakalinkissue37884 messages
2019-08-24 10:09:40serhiy.storchakacreate