7 Apr
2016
7 Apr
'16
9:53 p.m.
On Thu, Apr 7, 2016, at 12:00, Joseph Martinot-Lagarde wrote:
Ethan Furman <ethan@...> writes:
--> ~False -1 --> ~True -2
No. bool is a subclass of int, and changing that now would be a serious breach of backward-compatibility, not to mention breaking existing code for no good reason.
I get that "technically" it would be a backward incompatible change, but any code that relies on `~True == -2` has other problems than backward compatibility.
It's more a combination of other things that code may rely on: True == 1 False == 0 False + 1, False + True # truthy True + True == 2 # imagine implementing count_if_true() as sum(map(bool, ...))