[Python-ideas] [Python-ideos] Dedicated overloadable boolean operators

Guido van Rossum guido at python.org
Fri Nov 27 15:15:42 EST 2015


On Fri, Nov 27, 2015 at 11:43 AM, Brendan Barnwell <brenbarn at brenbarn.net>
wrote:

> On 2015-11-27 09:28, Andrew Barnert via Python-ideas wrote:
>
>> And finally, NumPy is one of the uses that doesn't require short
>> circuiting, and the same is almost certainly true for other
>> elementwise uses, and yet we seem to all be agreed that the new
>> overload has to be short-circuitable.
>>
>
>         Do we?  I don't.  I agree that if we add a way to overload the
> existing and/or to support these new usages, then that has to be
> short-circuitable. because and/or currently are short-circuitable and we
> can't get rid of that.  But to me one of the attractive aspects of this new
> proposal is that the new operators need not be short-circuitable, which
> would avoid the various contortions required in a scheme like PEP 335 and
> thus greatly simplify the overloading.  In other words the whole point of
> these new operators would be to do and-like and/or or-like operations that
> definitely do want both of their arguments all the time (such as
> elementwise operations or combining abstract query objects like in these
> SQL cases).
>

Agreed, that final clause from Andrew seems a non-sequitur.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151127/39ef7617/attachment-0001.html>


More information about the Python-ideas mailing list