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 Eric.Wieser
Recipients Eric.Wieser, josh.r, mark.dickinson, serhiy.storchaka, wolma
Date 2017-11-05.23:21:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509924098.68.0.213398074469.issue28716@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2017-11-05 23:21:38Eric.Wiesersetrecipients: + Eric.Wieser, mark.dickinson, serhiy.storchaka, wolma, josh.r
2017-11-05 23:21:38Eric.Wiesersetmessageid: <1509924098.68.0.213398074469.issue28716@psf.upfronthosting.co.za>
2017-11-05 23:21:38Eric.Wieserlinkissue28716 messages
2017-11-05 23:21:38Eric.Wiesercreate