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

as others have said, if you need an identity test use:

 any(x is False for x in theList)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to