Message409531
I don't think this is a door we should open:
>>> Fraction(3.5, 2.5)
Fraction(7, 5)
This currently raises a useful exception:
TypeError: both arguments should be Rational instances
That is especially helpful in avoiding cases like this:
>>> Fraction(1.1, 3.3)
Fraction(2476979795053773, 7430939385161318)
If that output is desired, the two conversions should be explicit.
>>> Fraction(1.1) / Fraction(3.3)
Fraction(2476979795053773, 7430939385161318
I recommend rejecting this feature request as being more likely to be hazardous than helpful. |
|
Date |
User |
Action |
Args |
2022-01-02 22:00:13 | rhettinger | set | recipients:
+ rhettinger, mark.dickinson, stutzbach, serhiy.storchaka, jdemeyer |
2022-01-02 22:00:13 | rhettinger | set | messageid: <1641160813.01.0.849266202179.issue37836@roundup.psfhosted.org> |
2022-01-02 22:00:12 | rhettinger | link | issue37836 messages |
2022-01-02 22:00:12 | rhettinger | create | |
|