This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients gphemsley, mark.dickinson, rhettinger
Date 2017-12-31.20:44:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514753048.12.0.467229070634.issue32466@psf.upfronthosting.co.za>
In-reply-to
Content
> but it would result in a behaviour change: for the above code, we'd get a `Fraction` whose numerator and denominator were both of actual type `int` instead of `mpz`

Ah, sorry. That's not true in this particular case. The returned gcd would be of type `int`, but then we end up dividing an `mpz` by an `int` to get an `mpz`. So I guess the problem case is where we have something that's like `mpz` but that doesn't support division by a plain `int`: I don't think there's any requirement that instances of numbers.Integral support mixed-type arithmetic with plain ints.

I'd actually be happier if the `fractions.Fraction` type *did* normalise so that its numerator and denominator always had exact type `int`, but that's not the way that it was designed: it was designed to support arbitrary numbers.Integral instances.
History
Date User Action Args
2017-12-31 20:44:08mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, gphemsley
2017-12-31 20:44:08mark.dickinsonsetmessageid: <1514753048.12.0.467229070634.issue32466@psf.upfronthosting.co.za>
2017-12-31 20:44:08mark.dickinsonlinkissue32466 messages
2017-12-31 20:44:07mark.dickinsoncreate