A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2011-May/111444.html below:

[Python-Dev] Don't set local variable in a list comprehension or generator

[Python-Dev] Don't set local variable in a list comprehension or generator [Python-Dev] Don't set local variable in a list comprehension or generatorNadeem Vawda nadeem.vawda at gmail.com
Wed May 18 16:19:59 CEST 2011
On Wed, May 18, 2011 at 2:21 PM, Victor Stinner
<victor.stinner at haypocalc.com> wrote:
> ''.join(c for c in 'abc') and ''.join([c for c in 'abc']) do create a
> temporary c variable.

I'm not sure why you would encounter code like that in the first place.
Surely any code of the form:

    ''.join(c for c in my_string)

would just return my_string? Or am I missing something?

> I heard about optimization in the AST tree instead of working on the
> bytecode. What is the status of this project?

Are you referring to issue11549? There was some related discussion [1] on
python-dev about six weeks ago, but I haven't seen anything on the topic
since then.

Cheers,
Nadeem

[1] http://mail.python.org/pipermail/python-dev/2011-April/110399.html
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