R. David Murray added the comment:

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."

----------
nosy: +r.david.murray

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

Reply via email to