[Python-ideas] PEP 505 (None coalescing operators) thoughts
Guido van Rossum
guido at python.org
Tue Sep 29 01:03:22 CEST 2015
On Mon, Sep 28, 2015 at 3:40 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 9/28/2015 3:38 PM, Emile van Sebille wrote:
>
>> On 9/28/2015 10:24 AM, Andrew Barnert via Python-ideas wrote:
>>
>>> On Sep 28, 2015, at 09:47, Sven R. Kunze
>>> <srkunze at mail.de> wrote:
>>>
>> <snip>
>>
>> I wouldn't make a mountain out of a molehill. Other existing
>>>> operators have the same issue.
>>>>
>>>
>>> Which other keywords or symbols may be either a binary operator or
>>> part of a ternary operator depending on context?
>>>
>>
>> These come to mind:
>>
>> a = b = c
>> a < b < c
>>
>
> These are chained comparisons, which get separated, not ternary operators.
> a < b = c < e > f in g is also syntactically valid, and I don't think
> anything is gained by calling it a pentanary operator.
>
But a < b < c is an excellent example of something that cannot be
mindlessly refactored into (a < b) < c.
--
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150928/fc63131a/attachment.html>
More information about the Python-ideas
mailing list