Message303788
fractions.Fraction enforces its numerator and denominator to be rational. This is a good idea for purely numeric fractions, but the abstractions that fractions.Fraction offers would also be useful for more abstract fractions.
Some places where this might be useful would be fractions of polynomial types or fractions with abstract irrational numeric types, like F(SquareRoot(3), 2).
This could be accomplished by having a more general Fraction superclass or by removing the requirement of rationality from fractions.Fraction. It is not trivial to create a subclass of Fraction that does this because the operators are hardcoded to use Fraction and initiation is done in __new__. |
|
Date |
User |
Action |
Args |
2017-10-05 23:08:26 | Ben Burrill | set | recipients:
+ Ben Burrill |
2017-10-05 23:08:26 | Ben Burrill | set | messageid: <1507244906.43.0.213398074469.issue31707@psf.upfronthosting.co.za> |
2017-10-05 23:08:26 | Ben Burrill | link | issue31707 messages |
2017-10-05 23:08:26 | Ben Burrill | create | |
|