either

bearophile bearophileHUGS at lycos.com
Sun Jan 9 12:18:50 PST 2011


Andrej Mitrovic:

> I think "any" is used in Python IIRC, so I'll have to go +1 with Robert here.

any() and all() in Python have a different purpose, the first is true if one or more than the given items is true, and the second is true if they all true:

>>> all([1, 2, 4])
True
>>> all(["", None, 0])
False
>>> all(["", None, 1])
False
>>> any(["", None, 1])
True
>>> any([1, 2, 4])
True
>>> any(["", None, 0])
False

Bye,
bearophile


More information about the Digitalmars-d mailing list