New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-100488: Add is_integer method to fractions.Fraction #100489
base: main
Are you sure you want to change the base?
Conversation
The documentation guarantees that denominator is in lowest term. It doesn't make any explicit guarantee about being positive, but |
@@ -117,6 +117,12 @@ another rational number, or from a string. | |||
|
|||
.. versionadded:: 3.8 | |||
|
|||
.. method:: is_integer() | |||
|
|||
Return True if the Fraction is an integer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: suggest inline code markup for True
:
Return True if the Fraction is an integer. | |
Return ``True`` if the Fraction is an integer. |
(We seem to be rather inconsistent about this across the codebase. The most authoritative source I could find is in the dev guide: https://devguide.python.org/documentation/markup/#quick-reference.)
is_integer
to fractions.Fraction #100488