Message309290
> [...] 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`.) |
|
Date |
User |
Action |
Args |
2017-12-31 16:08:06 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, gphemsley |
2017-12-31 16:08:06 | mark.dickinson | set | messageid: <1514736486.9.0.467229070634.issue32466@psf.upfronthosting.co.za> |
2017-12-31 16:08:06 | mark.dickinson | link | issue32466 messages |
2017-12-31 16:08:06 | mark.dickinson | create | |
|