[issue31707] Irrational fractions

2017-10-06 Thread Mark Dickinson
Mark Dickinson added the comment: I think this is way beyond the scope of the current fractions module. I'd suggest putting something on PyPI as a proof of concept. Given the negative response from other core developers, I'm going to close here. -- resolution: -> rejected stage: ->

[issue31707] Irrational fractions

2017-10-06 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: I would like to provide some colour to this discussion. In a former life I have coded these during my studies. Ben is talking about implementing the Field of Fractions of an Integral Domain. See https://en.wikipedia.org/wiki/Field_of_fractions The way Fr

[issue31707] Irrational fractions

2017-10-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Raymond. Even multiplication doesn't work for irrational numerator and denominator, since gcd() is not applicable to them. -- nosy: +serhiy.storchaka ___ Python tracker

[issue31707] Irrational fractions

2017-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Put me down for -1. This doesn't seem like standard library material. It doesn't seem to address a common need and it would add complexity to an already complicated module (nor does it seem to have a good fit with the numeric tower). The proposal seems l

[issue31707] Irrational fractions

2017-10-05 Thread Ben Burrill
Ben Burrill added the comment: The core operators, like multiplication and division, should work for any type that defines the right operators. Hashing is tricky, and reducing the fraction is pretty much off the table. This is why I suggested a superclass. I'll try making a patch sometime

[issue31707] Irrational fractions

2017-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: The fractions module isn't easily extended to support this proposal. It was designed around a gcd() step and assumes integer numerators and denominators throughout. Also, the Fraction class is registered with numbers.Rational() which implies some specifi

[issue31707] Irrational fractions

2017-10-05 Thread Ben Burrill
Change by Ben Burrill : -- nosy: +mark.dickinson, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue31707] Irrational fractions

2017-10-05 Thread Ben Burrill
New submission from Ben Burrill : 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 u