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.16:08:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514736486.9.0.467229070634.issue32466@psf.upfronthosting.co.za>
In-reply-to
Content
> [...] I cannot envision a scenario where that would be possible [...]

I don't think it can be ruled out. If I'm reading the code right, it's preceded by this branch of the initial if/elif chain:

        elif (isinstance(numerator, numbers.Rational) and
            isinstance(denominator, numbers.Rational)):
            numerator, denominator = (
                numerator.numerator * denominator.denominator,
                denominator.numerator * numerator.denominator
                )

I don't think there's any guarantee that if `numerator` is an instance of `numbers.Rational`, then `numerator.numerator` and `numerator.denominator` have exact type `int`.  (Note that an instance of `numbers.Rational` is not necessarily an instance of `fractions.Fraction`.)
History
Date User Action Args
2017-12-31 16:08:06mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, gphemsley
2017-12-31 16:08:06mark.dickinsonsetmessageid: <1514736486.9.0.467229070634.issue32466@psf.upfronthosting.co.za>
2017-12-31 16:08:06mark.dickinsonlinkissue32466 messages
2017-12-31 16:08:06mark.dickinsoncreate