Mark Dickinson <dicki...@gmail.com> added the comment:

> Making True == -1 looks interesting, but it has drawbacks.

Yes, please ignore that part of my post. :-) It shouldn't be considered 
seriously until a time machine turns up (and probably not even then).

My main worry with the proposed change is accidental breakage from the change 
in meaning. I've so far failed to find any examples of real-world functions 
that could/would be broken - the closest I've come is floating-point 
bit-pattern manipulation functions (constructing a bit-string from a sign, 
exponent and significand, where it's quite natural to treat the sign both as an 
"is_negative" boolean and as a 0-or-1 integer). But that case didn't involve a 
`~sign` at any point, so it doesn't count.

Still, I have a nagging suspicion that such a function will turn up if we make 
this change.

Having ~True *not* be the same as ~1 feels like a bigger surprise to me than 
having ~True not be False; it breaks my simple mental model that bools always 
behave like ints in numeric contexts.

----------

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

Reply via email to