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

[Python-Dev] PEP 572: Assignment Expressions

[Python-Dev] PEP 572: Assignment Expressions [Python-Dev] PEP 572: Assignment ExpressionsChris Barker - NOAA Federal chris.barker at noaa.gov
Fri Apr 20 01:08:48 EDT 2018
> On Apr 19, 2018, at 4:27 PM, Christoph Groth <christoph at grothesque.org> wrote:

<snip>

> def sync_runner(learner, f, static_hint):
>    while True:
>        points = learner.get(static_hint)
>        if not points:
>            break
>        learner.feed(f(points))
>
>
>
> With assignment expressions the body of the above function could be
> simplified to
>
> while points := learner.get(static_hint):
>    learner.feed(f(points))
>
> making it crucially simpler.

Kinda supports my assertion that what we really want is a different while loop.

Would it be ridiculous if := only worked in a while statement?

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