bpo-37819: Add Fraction.as_integer_ratio()#15212
Conversation
gvanrossum
left a comment
There was a problem hiding this comment.
I would change "exactly equal" to just "equal" -- there's nothing to be gained by adding "exactly".
Sorry, something went wrong.
aeros
left a comment
There was a problem hiding this comment.
Thanks for the PR @rhettinger.
I had some minor suggestions:
Sorry, something went wrong.
|
I didn't include this in my review since it's not directly related to the PR, but I noticed some minor inconsistencies in the tests between the different versions of self.assertRaises(ValueError,
Decimal.as_integer_ratio, Decimal('snan123'))Also, as far as I can tell, there's no test coverage at all for the int version of the method. Should I open a new issue for this? |
Sorry, something went wrong.
* The other methods spell fraction with a capital F.
* The word "original" doesn't make sense because the original
fraction is reduced:
Fraction(4, 6).as_integer_ratio() |-> (2, 3)
|
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
(cherry picked from commit f03b4c8) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
|
Should this |
Sorry, something went wrong.
https://bugs.python.org/issue37819