[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-19 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > Sorry, but I do not understand why adding Fraction.as_integer_ratio() > prevents adding math.as_integer_ratio(). I also support a public function for that. It seems that we're planning this "as_integer_ratio" thing to become public API, so why not have a

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, but I do not understand why adding Fraction.as_integer_ratio() prevents adding math.as_integer_ratio(). The user code can not benefit from this until we add as_integer_ratio() to all numeric numbers, and this is not realistic. For the same reason

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 5ba1cb03939bd86d026db667580f590966b573ea by Raymond Hettinger (Miss Islington (bot)) in branch '3.8': bpo-37819: Add Fraction.as_integer_ratio() (GH-15212) (GH-15215)

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset f03b4c8a48f62134799d368b78da35301af466a3 by Raymond Hettinger in branch 'master': bpo-37819: Add Fraction.as_integer_ratio() (GH-15212) https://github.com/python/cpython/commit/f03b4c8a48f62134799d368b78da35301af466a3 --

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +14943 pull_request: https://github.com/python/cpython/pull/15215 ___ Python tracker ___

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Guido van Rossum
Guido van Rossum added the comment: Let's continue on the current path -- add Fraction.as_integer_ratio(). Note that as_integer_ratio() is not part of the Numbers API, it is an optional protocol. You can count me out for Jeroen's __ratio__ proposal. --

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, would you like to go forward with this? IIRC, you had decided that adding as_integer_ratio() to all the relevant concrete classes was the way to go. We already had the method on floats and Decimals, and then it was added bool and float, so

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +14940 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15212 ___ Python tracker

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think this can still go in for Fractions because it completes a feature that was already started (providing the method for the concrete types where it makes sense). Altering numbers.py can be saved for the future. --

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This will not solve the problem completely, because other rational numbers do not have as_integer_ratio(). But all rational numbers have the numerator and denominator properties. See issue37822 for more general solution. -- nosy:

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, makes total sense to me to have it there. Question is more if we can still get it into Py3.8, since it's a new feature for fractions. -- nosy: +lukasz.langa, scoder ___ Python tracker

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Sanyam Khurana
Change by Sanyam Khurana : -- nosy: +CuriousLearner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37819] as_integer_ratio() missing from fractions.Fraction()

2019-08-11 Thread Raymond Hettinger
New submission from Raymond Hettinger : When working on Whatsnew3.8, I noticed that as_integer_ratio() had been added to ints and bools, was already present in floats and Decimals, but was missing from Fractions. IIRC, the goal was to make all of these have as a similar API so that