[Python-ideas] except expression

Chris Angelico rosuav at gmail.com
Thu Feb 20 05:53:14 CET 2014


On Thu, Feb 20, 2014 at 3:37 PM, Yury Selivanov <yselivanov.ml at gmail.com> wrote:
> On 2/19/2014, 11:24 PM, Chris Angelico wrote:
>>
>> On Thu, Feb 20, 2014 at 2:55 PM, Yury Selivanov <yselivanov.ml at gmail.com>
>> wrote:
>>>
>>> On 2/19/2014, 8:18 PM, Chris Angelico wrote:
>>>>
>>>> Advantages of the arrow include ->
>>>
>>> I would refrain from introducing a new operator here,
>>> especially '->'.
>>>
>>> This one may later be used for communication between
>>> channels/queues or other async stuff (like in golang,
>>> although they use '<-'.)
>>
>> Technically, -> does exist in the language:
>
> I know, and this is another reason to not to use
> '->' for the except expression.

I'd call that a medium-weak negative. If there were a current
competing proposal, then that would be a strong incentive to leave
that character stream alone. Reserving it for a hypothetical future
proposal is only a weak objection. It's unlikely that this would warp
any other protocol excessively, but it's impossible to warp this one
around a nebulous "maybe".

It is a small argument in favour of the colon, though, simply because
that doesn't have this problem. But a small argument.

>> I don't know if it's still available for use as an operator, but I'd
>> be extremely cautious about using <- as an operator; it could be
>> binary less-than followed by unary minus:
>
> Sorry, I can't find where I suggested to use '<-' in Python.

If -> got snaffled by exception handling, then async comms could just
say "oh, let's use the other then". But it would be problematic to.

ChrisA


More information about the Python-ideas mailing list