[issue27754] Changing the meaning of bool.__invert__

R. David Murray report at bugs.python.org
Sat Aug 13 17:40:41 EDT 2016


R. David Murray added the comment:

Well, in this context "in 3.6" means "in the next feature release", so it isn't as if the window closes forever.

I'd vote -1 myself.  It doesn't seem like a useful enough feature to be worth adding, given that ~x is equivalent to "not x" for booleans, but "not x" returns a bool regardless of what x is while ~ doesn't.  In fact, I'd classify it as an attractive nuisance.

Note also that & and | return booleans only when both operands are boolean, but the value of expression as an integer is the same regardless of the type returned.  This would not be true for ~.

So, I vote for "officially dropped".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27754>
_______________________________________


More information about the Python-bugs-list mailing list