It is an improvement if there's no function. I think<div><br></div><div>    any(i > 3 for i in foo)</div><div><br></div><div>is more readable than</div><div><br></div><div>    any(map(lambda i: i > 3, foo))</div>

<div><br></div><div>As to the original suggestion, the length of any(foo, test=bar) vs any(map(bar, foo)) is about the same. So I think this doesn't make anything simpler and unnecessarily adds complexity to any/all which then will inevitably lead to suggestions to make other things more complicated to match them.</div>

<div><div><div><br clear="all">--- Bruce<br><div>Learn about security: <a href="http://j.mp/gruyere-security" target="_blank">http://j.mp/gruyere-security</a></div><br>
<br><br><div class="gmail_quote">On Sun, Nov 21, 2010 at 12:20 PM, Masklinn <span dir="ltr"><<a href="mailto:masklinn@masklinn.net">masklinn@masklinn.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 2010-11-21, at 21:11 , MRAB wrote:<br>
><br>
> if any(mytestfunction(i) for i in mylist):<br>
>    foo()<br>
<br>
</div>is not an improvement over `if any(map(mytestfunction, mylist))` or `if any(imap(mytestfunction, mylist))`<br>
<div><div></div><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br></div></div></div>