Skip to content

Conversation

@jdemeyer
Copy link
Contributor

@jdemeyerjdemeyer commented Aug 18, 2019

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 numerator and denominator may now be any objects with an as_integer_ratio() method.
@aerosaeros added the type-feature A feature request or enhancement label Aug 22, 2019
@rhettinger
Copy link
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.

@serhiy-storchaka
Copy link
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).

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

Labels

awaiting core reviewtype-featureA feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

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