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

bpo-37822: Add math.as_integer_ratio(). by serhiy-storchaka · Pull Request #15210 · python/cpython · GitHub

/ cpython Public

bpo-37822: Add math.as_integer_ratio(). - #15210

Closed
serhiy-storchaka wants to merge 2 commits into
python:masterfrom
serhiy-storchaka:math-as_integer_ratio
Closed

bpo-37822: Add math.as_integer_ratio().#15210
serhiy-storchaka wants to merge 2 commits into
python:masterfrom
serhiy-storchaka:math-as_integer_ratio

Conversation

serhiy-storchaka commented Aug 11, 2019
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Contributor

I think it would be good to define more precisely what are the output types. We require the output of as_integer_ratio to be two integers, but what does "integer" mean in this context? A Python int? An object which implements __index__? An instance of numbers.Integral?

My personal vote would be to require __index__ (I don't mean that we should check that condition, but we should document it).

brandtbucher 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

One small issue I noticed:

Comment thread Modules/mathmodule.c
math.as_integer_ratio
x: object
/
greatest common divisor of x and y

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

This looks like a copy-paste error. Maybe:

Suggested change
greatest common divisor of x and y
Return the rational representation of x as the pair (numerator, denominator).

Copy link
Copy Markdown
Member Author

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

Thank you. But this proposition was rejected.

serhiy-storchaka deleted the math-as_integer_ratio branch August 24, 2019 09: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

awaiting core review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL