<div dir="ltr">> <span style="font-family:arial,sans-serif;font-size:13px"> X in any(Y, Z)</span><br style="font-family:arial,sans-serif;font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">It also doesn't have the desired laziness, unless we special case <b>any</b> in the interpreter, or provide a more generic mechanism for lazy parameters without writing <b>lambda: </b>everywhere</span></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 3:26 PM, Amber Yust <span dir="ltr"><<a href="mailto:amber.yust@gmail.com" target="_blank">amber.yust@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The issue I see with "X in any(Y, Z)" is that it's unclear to the reader how it differs from "X in (Y,Z)".<div class="HOEnZb">

<div class="h5"><br><br><div>On Thu Feb 13 2014 at 3:23:41 PM, Carl Meyer <<a href="mailto:carl@oddbird.net" target="_blank">carl@oddbird.net</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 02/13/2014 04:04 PM, Greg Ewing wrote:<br>
[snip]<br>
> A syntax along the lines of<br>
><br>
>    X in either Y or Z<br>
><br>
> would avoid the problem. But we don't have a good<br>
> candidate for 'either' that's already a keyword.<br>
<br>
This makes me think of<br>
<br>
    X in any(Y, Z)<br>
<br>
which is equally concise, and I think clearer and more readable (for<br>
garden-path reasons) than<br>
<br>
    X in Y or in Z<br>
<br>
It's also technically not ambiguous, since currently any() only takes<br>
one argument, and "X in any(Y)" is useless. Still a confusing overload<br>
of the meaning of any().<br>
<br>
Implementation would be a bit ugly; it would need to return an object<br>
that implements every operator magic method, and "distributes" the<br>
operation across the objects passed to it. Equivalent could be done for<br>
all().<br>
<br>
Or different names could be chosen to avoid the overloads, though I'm<br>
not sure what those names would be.<br>
<br>
Probably there be dragons, but it might be fun to experiment with (and<br>
doesn't require changes to the language, only new/modified builtins, or<br>
even just library additions).<br>
<br>
Carl<br>
______________________________<u></u>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/<u></u>codeofconduct/</a><br>
</blockquote>
</div></div><br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br></blockquote></div><br></div>