[Python-ideas] except expression

Chris Angelico rosuav at gmail.com
Thu Feb 20 05:24:03 CET 2014


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:

http://www.python.org/dev/peps/pep-3107/

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:

>>> 1 <- 2
False

Demanding space around binary operators is the job of style guides,
but creating <- as an operator would mean first moving that demand
into the language (at least in some places).

ChrisA


More information about the Python-ideas mailing list