bool behavior in Python 3000?

Nick Craig-Wood nick at
Wed Jul 11 22:30:03 CEST 2007

Alan Isaac <aisaac at> wrote:
>  Miles wrote:
> > What boolean operation does '-' represent?
>  Complementation.
>  And as usual, a-b is to be interpreted as a+(-b).
>  In which case the desired behavior is
>   False-True = False+(-True)=False+False = False

If you want to do algebra with bools in python then use the logical
operators (and or not) and not the arithmetical operators.


  >>> False or not True

Nick Craig-Wood <nick at> --

More information about the Python-list mailing list