[Python-ideas] Spelling of Assignment Expressions PEP 572 (was post #4)

Ned Batchelder ned at nedbatchelder.com
Mon Apr 16 14:09:56 EDT 2018


On 4/16/18 1:42 PM, Chris Angelico wrote:
> 3) "expr -> name" ==> The information went data way.
>
> So either you take a parallel from elsewhere in Python syntax, or you
> take a hopefully-intuitive dataflow mnemonic symbol. Take your pick.

My problem with the "->" option is that function annotations already use 
"->" to indicate the return type of a function.  This is an unfortunate 
parallel from elsewhere in Python syntax, since the meaning is 
completely different.

":=" is at least new syntax.

"as" is nice in that it's already used for assignment, but seems to be 
causing too much difficulty in parsing, whether by compilers or people.

--Ned.


More information about the Python-ideas mailing list