[Python-ideas] Changing the meaning of bool.__invert__

Antoine Pitrou antoine at python.org
Thu Apr 7 09:17:57 EDT 2016


Steven D'Aprano <steve at ...> writes:
> 
> > Numpy's boolean type does the more useful (and more expected) thing:
> > 
> > >>> ~np.bool_(True)
> > False
> 
> Expected by whom?

By anyone who takes booleans at face value (that is, takes booleans as
representing a truth value and expects operations on booleans to reflect
the semantics of useful operations on truth values, not some arbitrary
side-effect of the internal representation of a boolean...).

But I'm not surprised by such armchair commenting and pointless controversy
on python-ideas, since that's what the list is for....

Regards

Antoine.




More information about the Python-ideas mailing list