2009/7/16 Hendrik van Rooyen <m...@microcorp.co.za>: > "Hrvoje Niksic" <hnik...@x..s.org> wrote: > > >> Note that in Python A or B is in fact not equivalent to not(not A and >> not B). > > De Morgan would turn in his grave.
If this can make him happier, in Python (not (not a and not b)) *is* equivalent to bool(a or b). (Modulo crazy things like redefining "bool" or having a __bool__ with side effects.) In the first expression you implicitly request a bool because you use "not", in the second one you do this with an explicit "bool". -- Lino Mastrodomenico -- http://mail.python.org/mailman/listinfo/python-list