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/153171.html below:

[Python-Dev] Is PEP 572 really the most effective way to solve the problems it's targeting?

[Python-Dev] Is PEP 572 really the most effective way to solve the problems it's targeting?Steven D'Aprano steve at pearwood.info
Thu Apr 26 20:58:16 EDT 2018
On Thu, Apr 26, 2018 at 09:36:48AM -0700, Mike Miller wrote:

> However, there were two good questions in this message which I haven't seen 
> addressed yet:
> 
>     - How are other modern languages solving this issue?
>     - How does this new construct intersect with typing functionality?

What counts as a modern language? Less than five years old? Less than 
fifty years old? Are Javascript, Ruby and R modern? They all support 
assignment as expressions.

I think Koitlin, Rust and Go prohibit assignment as expressions.

Swift assignment evaluates as Void (equivalent to None in Python, I 
guess), so you can use assignment in an expression but it returns 
nothing and only operates by side-effect.

As far as type hints go, I think that if you need explicit type hints in 
the middle of an expression, it's a bad idea and you ought to pull it 
out as a separate statement. That applies regardless of whether that 
expression involves binding or not.


-- 
Steve
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