Duncan Booth <[EMAIL PROTECTED]> writes: > Paul Rubin <http://[EMAIL PROTECTED]> wrote: > >> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >>> >> status = all(list) >>> > >>> > Am I mistaken, or is this no identity test for False at all? >>> >>> You are mistaken. all take an iterable and returns if each value of >>> it is true. >> >> all(list) does what the OP's code did, tests for the presence of a >> false value in the list. If you want an identity test, use >> >> status = not (False in list) > > That is an equality test, not an identity test: > >>>> False in [0] > True
It's also not a very idiomatic equality test -- "x not in y" is better than "not (x in y)". John -- http://mail.python.org/mailman/listinfo/python-list