GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-37836: support .as_integer_ratio() in Fraction by jdemeyer · Pull Request #15327 · python/cpython

Conversation

@jdemeyer

@jdemeyer jdemeyer commented Aug 18, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jdemeyer
bpo-37836: support .as_integer_ratio() in Fraction
2fe964f
When constructing instances of fractions.Fraction, the given numerator
and denominator may now be any objects with an as_integer_ratio() method.
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Aug 18, 2019
@bedevere-bot bedevere-bot added the awaiting review label Aug 18, 2019
@jdemeyer
bpo-37836: optimize creating Fraction from integers
f1b1e8c
@jdemeyer jdemeyer mentioned this pull request Aug 19, 2019
bpo-37836: document as_integer_ratio() in the data model #15328
Closed
@aeros aeros added the type-feature A feature request or enhancement label Aug 22, 2019
aeros
aeros reviewed Aug 22, 2019
View reviewed changes
Comment thread Lib/fractions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

epicfaace
epicfaace suggested changes Aug 23, 2019
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2019-08-18-22-29-59.bpo-37836.BbvvFm.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/fractions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/fractions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/fractions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/fractions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/fractions.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/fractions.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_fractions.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Aug 23, 2019
@jdemeyer
bpo-37836: minor fixes
9c7bdb5
epicfaace
epicfaace approved these changes Aug 25, 2019
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2019-08-18-22-29-59.bpo-37836.BbvvFm.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer @epicfaace
bpo-37836: detail in NEWS
d230396
Co-Authored-By: Ashwin Ramaswami <[email protected]>
@rhettinger

rhettinger commented Apr 20, 2022

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger rhettinger closed this Apr 20, 2022
@serhiy-storchaka

serhiy-storchaka commented Apr 21, 2022

Copy link
Copy Markdown
Member

I concur with @rhettinger.

I am even think that if Fraction() 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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer jdemeyer mentioned this pull request Apr 21, 2022
Support .as_integer_ratio() in fractions.Fraction #82017
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@aeros aeros aeros left review comments
@epicfaace epicfaace epicfaace approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@jdemeyer @rhettinger @serhiy-storchaka @epicfaace @aeros @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.