Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'migration': 0.07; 'python': 0.08; 'iterate': 0.09; 'kelly': 0.09; 'wrote:': 0.14; '"right"': 0.16; '-0600': 0.16; 'received:213.165.64.23': 0.16; 'scope,': 0.16; 'received:(qmail invoked by alias)': 0.16; 'received:213.165.64': 0.16; 'tue,': 0.17; 'received:gmx.net': 0.19; 'header:In-Reply-To:1': 0.21; 'variable': 0.21; 'issues.': 0.23; 'values': 0.25; 'received:213.165': 0.25; 'change.': 0.32; 'cheers': 0.32; 'martin': 0.32; 'to:addr:python-list': 0.33; 'list': 0.33; 'however,': 0.34; 'using': 0.35; 'charset:us-ascii': 0.36; 'takes': 0.37; 'subject:: ': 0.38; 'should': 0.39; 'header :Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'received:93': 0.80; 'worrying': 0.91 X-Authenticated: #450581 X-Provags-ID: V01U2FsdGVkX18Q/jp6mMwQXmj66n71h0Xj15sJnKJOK0Xb4dWadT MzI6Sq7Zvi2MWO Date: Wed, 1 Jun 2011 02:57:52 +0200 From: Martin Manns To: python-list@python.org Subject: Re: Something is rotten in Denmark... In-Reply-To: References: <20110531231456.44d388d7@Fuddel> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.24.4; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306889855 news.xs4all.nl 49184 [::ffff:82.94.164.166]:37553 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6771 On Tue, 31 May 2011 15:47:33 -0600 Ian Kelly wrote: > The i variable is part of the global scope, and as you iterate over > range(10) again it coincidentally takes on the same values as in the > original list comprehension. You don't see this in Python 3 because > the scope of i is limited to the list comprehension, not global. I read about the scope change. However, list comprehension scope being global still feels "right" for me because I am still using Python 2. I feel that I should start worrying more about future migration issues. Cheers Martin