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 facundobatista, mark.dickinson, rhettinger, serhiy.storchaka, skrah
Date 2015-12-28.22:48:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451342898.0.0.236832633563.issue25971@psf.upfronthosting.co.za>
In-reply-to
Content
Proposed patch makes following things:

1. Rewrite error messages in float.as_integer_ratio() and Python implementation of Decimal.as_integer_ratio() in more general form, not mentioning as_integer_ratio(), as in C implementation of Decimal.as_integer_ratio().

2. Use Decimal.as_integer_ratio() to convert Decimal to Fraction.

3. Get rid of additional checks in Fraction constructor that raise errors with appropriate messages, since new error messages from as_integer_ratio() are appropriate enough.

This speeds up creating a Fraction from float and Decimal 2 to 3 times.
History
Date User Action Args
2015-12-28 22:48:18serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, facundobatista, mark.dickinson, skrah
2015-12-28 22:48:17serhiy.storchakasetmessageid: <1451342898.0.0.236832633563.issue25971@psf.upfronthosting.co.za>
2015-12-28 22:48:17serhiy.storchakalinkissue25971 messages
2015-12-28 22:48:17serhiy.storchakacreate