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 r.david.murray
Recipients docs@python, mark.dickinson, r.david.murray, terry.reedy, wohlganger
Date 2017-07-25.19:46:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501012003.06.0.948030349421.issue31021@psf.upfronthosting.co.za>
In-reply-to
Content
I think Terry and his OP are reacting to the fact that "-190 % 12 == -10" looks like it is saying that that expression is True in Python, which it is not (and that's the point).

IMO, another issue is that "and then compilers that truncate i // j need to make i % j have the same sign as i." doesn't have enough connection in the naive reader's mind with "-190 % 12 == -10 is a bug waiting to bite" for easy comprehension.  

A potential fix to both these issues would be to say "if -190 % 12 were equal to -10 in Python (the way it is in most C programs), that would quite often be a bug waiting to happen in code using the % operator."
History
Date User Action Args
2017-07-25 19:46:43r.david.murraysetrecipients: + r.david.murray, terry.reedy, mark.dickinson, docs@python, wohlganger
2017-07-25 19:46:43r.david.murraysetmessageid: <1501012003.06.0.948030349421.issue31021@psf.upfronthosting.co.za>
2017-07-25 19:46:43r.david.murraylinkissue31021 messages
2017-07-25 19:46:43r.david.murraycreate