Author mark.dickinson
Recipients elias, mark.dickinson, rhettinger
Date 2018-02-28.16:12:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519834340.67.0.467229070634.issue32968@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not quite sure why `Fraction_instance % float_instance` wouldn't simply convert the `Fraction` to a `float` and then use the usual floating-point mod. There's the issue that you want to maintain consistency with the floordiv operation, but if `Fraction_instance // float_instance` _also_ converts its first argument to float, then that consistency should follow automatically.

That's the pattern that's followed for most of the other binary arithmetic operators. It looks like the inconsistency is caused by using `_operator_fallbacks` for most of the operations, but doing something more ad-hoc for modulo.

I agree that the current behaviour is surprising.
History
Date User Action Args
2018-02-28 16:12:20mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, elias
2018-02-28 16:12:20mark.dickinsonsetmessageid: <1519834340.67.0.467229070634.issue32968@psf.upfronthosting.co.za>
2018-02-28 16:12:20mark.dickinsonlinkissue32968 messages
2018-02-28 16:12:20mark.dickinsoncreate