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 mark.dickinson
Recipients mark.dickinson, rhettinger
Date 2010-04-02.20:42:38
SpamBayes Score 1.10903e-05
Marked as misclassified No
Message-id <>
Here's a patch that allows direct construction of a Fraction instance from a float or Decimal instance, performing an exact conversion in either case.

>>> from fractions import Fraction
>>> from decimal import Decimal
>>> Fraction(1.1)
Fraction(2476979795053773, 2251799813685248)
>>> Fraction(Decimal('1.1'))
Fraction(11, 10)
>>> Fraction(Decimal(1.1))
Fraction(2476979795053773, 2251799813685248)
Date User Action Args
2010-04-02 20:42:43mark.dickinsonsetrecipients: + mark.dickinson, rhettinger
2010-04-02 20:42:42mark.dickinsonsetmessageid: <>
2010-04-02 20:42:41mark.dickinsonlinkissue8294 messages
2010-04-02 20:42:41mark.dickinsoncreate