In <291d82b7-b13b-4f49-901c-8194f3e07...@e7g2000yqf.googlegroups.com> nn <prueba...@latinmail.com> writes:
>If you are in Python 3 "any(map(is_invalid, L))" should short circuit. >If you are in Python 2 use "from itertools import imap; >any(imap(is_invalid, L))" Thanks! I'm glad to know that one can get the short circuiting using a map-type idiom. (I prefer map over comprehensions when I don't need to define a function just for the purpose of passing it to it.) And thanks also to the other repliers for pointing out that the comprehension version does what I was asking for. ~K -- http://mail.python.org/mailman/listinfo/python-list