[issue37819] as_integer_ratio() missing from fractions.Fraction()

Serhiy Storchaka report at bugs.python.org
Mon Aug 19 01:37:40 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Sorry, but I do not understand why adding Fraction.as_integer_ratio() prevents adding math.as_integer_ratio().

The user code can not benefit from this until we add as_integer_ratio() to all numeric numbers, and this is not realistic. For the same reason there is str.join() which works with arbitrary iterable instead of adding the join() method to all collections, iterators and generators.

math.as_integer_ratio() makes the user code more general, clear and fast.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37819>
_______________________________________


More information about the Python-bugs-list mailing list