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

[Python-Dev] listcomps vs. for loops

[Python-Dev] listcomps vs. for loops [Python-Dev] listcomps vs. for loopsGuido van Rossum guido at python.org
Mon Oct 20 13:48:00 EDT 2003
> >> 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).
> 
> ?!?!  When listcomps were introduced, you were strongly against any
> changes that would make it difficult to switch back and forth between a
> listcomp and its corresponding equivalent for loop.

I don't recall what I said then.  Did I say it was a feature that

  L = [x for x in R]
  print x

would print the last item of R?

> Are you changing your position or are you suggesting that for loops
> should grow private names?

No, only list comps.

--Guido van Rossum (home page: http://www.python.org/~guido/)

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