A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-April/153155.html below:

[Python-Dev] (name := expression) doesn't fit the narrative of PEP 20

[Python-Dev] (name := expression) doesn't fit the narrative of PEP 20 [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20Terry Reedy tjreedy at udel.edu
Thu Apr 26 15:05:23 EDT 2018
On 4/26/2018 6:34 AM, Greg Ewing wrote:
> Antoine Pitrou wrote:
>> Well, how do languages where assignment is an expression returning the
>> assigned value make their REPLs work?  I'm sure they don't inflict that
>> on their users, so it's certainly a solvable problem.
> 
> I can't think of any such language that has a REPL
> offhand, but here's a possible solution:
> 
> 
>     x := expr # doesn't print anything

Ugh! The only reason I would bother typing the : in a top level 
assignment would be to get the print without having to retype the name, 
as in

 >>> x = expr
 >>> x

I consider echoing top-level interactive assignments to be a feature of 
the proposal.

-- 
Terry Jan Reedy


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4