FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-100488: Add is_integer method to fractions.Fraction by hauntsaninja · Pull Request #100489 · python/cpython · GitHub

/ cpython Public

gh-100488: Add is_integer method to fractions.Fraction - #100489

Merged
hauntsaninja merged 3 commits into
python:mainfrom
hauntsaninja:fraction-is-integer
Jan 1, 2023
Merged

gh-100488: Add is_integer method to fractions.Fraction#100489
hauntsaninja merged 3 commits into
python:mainfrom
hauntsaninja:fraction-is-integer

Conversation

hauntsaninja commented Dec 24, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

The documentation guarantees that denominator is in lowest term. It doesn't make any explicit guarantee about being positive, but as_integer_ratio does and just returns the denominator. But do let me know if I should change to abs(self._denominator) == 1 or self._numerator % self._denominator == 0!

JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(But let's wait for Mark to also give feedback.)

mdickinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM; one reST markup nitpick.

Comment thread Doc/library/fractions.rst Outdated
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
hauntsaninja merged commit e83f88a into python:main Jan 1, 2023
hauntsaninja deleted the fraction-is-integer branch January 1, 2023 08:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL