<br><br><div class="gmail_quote">On 27 July 2010 17:42, Alexander Belopolsky <span dir="ltr"><<a href="mailto:alexander.belopolsky@gmail.com">alexander.belopolsky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Tue, Jul 27, 2010 at 11:59 AM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
..<br>
<div class="im">>> So it doesn't help that 'in' may return something else than a bool<br>
>> because the method is called on the wrong object for your purposes.<br>
><br>
> Well that pretty much kills the proposal. I can't believe nobody<br>
> (including myself) figured this out earlier in the thread. :-(<br>
<br>
</div>It may kill a use case or two, but not the proposal.   In the<br>
libraries like numpy where all python containers get replaced, this is<br>
not an issue.   Also this problem invites __rcontains__ solution, </blockquote><div><br><br>Wasn't the lack of an __rcontains__ a problem for the web-sig guys trying to work out the bytes / strings issue?<br><br>For what it's worth I think that guido is correct that a better solution for the expression -> query problem is to introduce an expression tree, as is done for LINQ (which has been enormously popular amongst .NET developers).<br>
<br>All the best,<br><br>Michael Foord<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">but<br>
the proposal is not very attractive to begin with.   IMO, operators<br>
that are not symbols  such as +, - or &, but words such as 'in', 'not'<br>
or 'and' don't offer much advantage over function calls.<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><br clear="all"><br>-- <br><a href="http://www.voidspace.org.uk">http://www.voidspace.org.uk</a><br><br><br>