A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2018-April/153175.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? [Python-Dev] Is PEP 572 really the most effective way to solve the problems it's targeting?INADA Naoki songofacandy at gmail.com
Thu Apr 26 22:15:20 EDT 2018
On Fri, Apr 27, 2018 at 10:52 AM Paul G <paul at ganssle.io> wrote:

> Rust has a few syntactic ways to accomplish the same thing, though. I
think match expressions are used for the equivalent of conditionals that
carry the condition value into the body of the expression, and all blocks
return the result of the last statement, so you can do things like:

> let mut x;
> while { x = foo(); x } {
> bar(x);
> }


Go is similar to Python; it's doesn't allow assignment in expression.
And Go has similar syntax like above;

for x := foo(); x {
     bar(x)
}
if err := baz(); err != nil {
     return err
}

I like Go and I think this syntax can be ported to Python.
But it help only if/while statements.  It doesn't help list comprehension.
And Go doesn't have list comprehension.
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