bool behavior in Python 3000?
nick at craig-wood.com
Wed Jul 11 22:30:03 CEST 2007
Alan Isaac <aisaac at american.edu> wrote:
> Miles wrote:
> > What boolean operation does '-' represent?
> 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 craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list