Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-37836: support .as_integer_ratio() in Fraction#15327

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@jdemeyer
Copy link
Contributor

@jdemeyerjdemeyer commentedAug 18, 2019
edited by bedevere-bot
Loading

When constructing instances of fractions.Fraction, the given numerator
and denominator may now be any objects with an as_integer_ratio() method.

CC@serhiy-storchaka ,@rhettinger

https://bugs.python.org/issue37836

When constructing instances of fractions.Fraction, the given numeratorand denominator may now be any objects with an as_integer_ratio() method.
@aerosaeros added the type-featureA feature request or enhancement labelAug 22, 2019
Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>
@rhettinger
Copy link
Contributor

I believe we're decided that no one needs this and that it may even be hazardous — especially when acceptingFraction(2.5, 4.5) when the entire point of the fractions module is to achieve exactness by working with integer arithmetic.

@serhiy-storchaka
Copy link
Member

I concur with@rhettinger.

I am even think that ifFraction() is called with two arguments, both of them must be integers. But the ship is already sailed, and I am not want to argue about deprecating the current behavior (accepting Rationals).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@aerosaerosaeros left review comments

@epicfaaceepicfaaceepicfaace approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

awaiting core reviewtype-featureA feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@jdemeyer@rhettinger@serhiy-storchaka@epicfaace@aeros@the-knights-who-say-ni@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp