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

[Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

[Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)Chris Angelico rosuav at gmail.com
Mon Jun 25 15:42:43 EDT 2018
On Tue, Jun 26, 2018 at 5:37 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> How loop variables might be isolated without a nested scope: After a
> comprehension is parsed, so that names become strings, rename the loop
> variables to something otherwise illegal.  For instance, i could become
> '<i>', just as lambda becomes '<lambda>' as the name of the resulting
> function.  Expand the comprehension as in Python 2, except for deleting the
> loop names along with the temporary result name.
>
> Assignment expressions within a comprehension would become assignment
> expressions within the for loop expansion and would automatically add or
> replace values in the namespace containing the comprehension.  In other
> words, I am suggesting that if we want name expressions in comprehensions to
> act as they would in Python 2, then we should consider reverting to an
> altered version of the Python 2 expansion.

So..... sublocal scopes, like in the earliest versions of PEP 572?

The wheel turns round and round, and the same spokes come up.

ChrisA
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