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/2003-October/039070.html below:

[Python-Dev] accumulator display syntax

[Python-Dev] accumulator display syntax [Python-Dev] accumulator display syntaxAlex Martelli aleaxit at yahoo.com
Mon Oct 20 11:45:36 EDT 2003
On Monday 20 October 2003 04:30 pm, Guido van Rossum wrote:
> > We are indeed sure (sadly) that list comprehensions leak control variable
> > names.
>
> But they shouldn't.  It can be fixed by renaming them (e.g. numeric
> names with a leading dot).

Hmmm, sorry?

>>> [.2 for .2 in range(3)]
SyntaxError: can't assign to literal

I think I don't understand what you mean.


> > We can hardly be sure of what iterator comprehensions would be
> > defined to do, given they don't exist, but surely we can HOPE that
> > in an ideal world where iterator comprehensions were part of Python
> > they would not be similarly leaky:-).
>
> It's highly likely that the implementation will have to create a
> generator function under the hood, so they will be safely contained in
> that frame.

And there will be much rejoicing...!-)


Alex


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