Mark Dickinson <dicki...@gmail.com> added the comment:

> [...] 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`.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32466>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to