On 2009-01-31, Vlastimil Brom <vlastimil.b...@gmail.com> wrote: > 2009/1/31 AJ Ostergaard <a...@cubbyhole.net>: >> Hi Ralf, >> >> Thanks for that but why: >> >>>>> '' and True >> '' >> >> Surely that should be False?!? >> >> Regards, >> AJ >> >> > see the docs: > http://docs.python.org/reference/expressions.html#boolean-operations > > "The expression x and y first evaluates x; if x is false,
But that doesn't mean "x is False" in the strict Python expression sense of the phrase. It means if bool(x) is False (or something reasonably close to that). > its value is returned; otherwise, y is evaluated and the > resulting value is returned." -- Grant -- http://mail.python.org/mailman/listinfo/python-list