Eric Wieser <wieser.eric+py...@gmail.com> added the comment: > allows Fraction instantiation from duck-typing classes that provide > as_integer_ratio
This would allow the numpy `np.floating` types to take part in `Fraction` conversion as well, which would be great. As far as I can tell, `Decimal` already follows this duck-typing, so it would be a shame for other modules not to. Perhaps an `num, den = operator.rational(x)` is needed to unify this code across the places that coerce rational numbers. ---------- nosy: +Eric.Wieser _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue28716> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com