<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>I find it frustrating that they always return booleans. It would
be more useful if any() returned the first true value it finds.
This seems like a backward-compatible-enough change to me... :)<br>
</p>
<p>--Ned.<br>
</p>
<br>
<div class="moz-cite-prefix">On 8/1/17 9:32 AM, Markus Meskanen
wrote:<br>
</div>
<blockquote
cite="mid:CAJAvhDYb4oa4fEXmrVeZAnU9DPtqDk9ibk3LbmnTqxga-o0Whw@mail.gmail.com"
type="cite">
<div dir="auto">
<div>I'd be more interested in supporting the "key" function:</div>
<div dir="auto"><br>
</div>
<div dir="auto">any(users, key=User.is_admin)</div>
<div dir="auto"><br>
</div>
<div dir="auto">As opposed to:</div>
<div dir="auto"><br>
</div>
<div dir="auto">any(user.is_admin() for user in users)<br>
<div class="gmail_extra" dir="auto"><br>
<div class="gmail_quote">1.8.2017 16.07 "Louie Lu" <<a
moz-do-not-send="true" href="mailto:me@louie.lu">me@louie.lu</a>>
kirjoitti:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
all,<br>
<br>
In "min" and "max" builtin-func, it support two style of
args:<br>
<br>
min(...)<br>
min(iterable, *[, default=obj, key=func]) ->
value<br>
min(arg1, arg2, *args, *[, key=func]) ->
value<br>
<br>
But for "any" and "all", it only support iterable:<br>
<br>
all(iterable, /)<br>
Return True if bool(x) is True for all values x
in the iterable.<br>
<br>
<br>
I'm not sure if this is discuss before, but can "any"
and "all"<br>
support like min_max "arg1, arg2, *args" style?<br>
<br>
<br>
Thanks,<br>
Louie.<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a moz-do-not-send="true"
href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a moz-do-not-send="true"
href="https://mail.python.org/mailman/listinfo/python-ideas"
rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a moz-do-not-send="true"
href="http://python.org/psf/codeofconduct/"
rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a>
Code of Conduct: <a class="moz-txt-link-freetext" href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a>
</pre>
</blockquote>
<br>
</body>
</html>