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

[Python-Dev] List comprehensions

[Python-Dev] List comprehensions [Python-Dev] List comprehensionsRaymond Hettinger python@rcn.com
Wed, 26 Jun 2002 16:48:23 -0400
From: "Gerald S. Williams" <gsw@agere.com>

> I don't want to rehash any old discussions, but I came across a surprise
> recently while converting constructs like "map(lambda x:x+1,x)" and just
> wanted to see the rationale behind not creating a local scope for list
> comprehension variables.

The idea was to make a = [expr(i) for i in seqn]; print i behave the same
as:

a = []
for i in seqn:
    a.append(expr(i))
print i  # i is in locals in its final loop state


Raymond Hettinger







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