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

Steve Barnes gadgetsteve at live.co.uk
Mon Apr 16 15:11:55 EDT 2018


> Here are the three most popular syntax options, and how each would be explained:
> 
> 1) "target := expr" ==> It's exactly the same as other forms of
> assignment, only now it's an expression.
> 2) "expr as name" ==> It's exactly the same as other uses of "as",
> only now it's just grabbing the preceding expression, not actually
> doing anything with it
> 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.
> 
> ChrisA
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 

How about "name being expression" - this avoids the already used "as" 
while being searchable, reasonably short and gives a reasonably clear, 
(at least to English speakers), indication of what is going on. It can 
also be typed on an ASCII keyboard without having to have a helper 
program or memorising Unicode codes and can be displayed or printed 
without having to install specialised fonts.

If a postfix notation is considered desirable, either instead or as well 
as "being", then possibly another synonym would suit such as "expression 
stored_as name" or "expression storedas name" (not apologies for the 
awkward name as I personally find it an awkward construction just like 
Reverse Polish).
-- 
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

---
This email has been checked for viruses by AVG.
http://www.avg.com



More information about the Python-ideas mailing list