New submission from Ben Burrill <bburril...@gmail.com>: 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__. ---------- components: Library (Lib) messages: 303788 nosy: Ben Burrill priority: normal severity: normal status: open title: Irrational fractions type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31707> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com