Message350358
> 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:
try:
as_integer_ratio = x.as_integer_ratio
except AttributeError:
n = x.numerator
d = x.denominator
else:
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:40 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, steven.daprano, jdemeyer |
2019-08-24 10:09:40 | serhiy.storchaka | set | messageid: <1566641380.85.0.479847824834.issue37884@roundup.psfhosted.org> |
2019-08-24 10:09:40 | serhiy.storchaka | link | issue37884 messages |
2019-08-24 10:09:40 | serhiy.storchaka | create | |
|