On Tue, 31 May 2011 15:47:33 -0600 Ian Kelly <ian.g.ke...@gmail.com> 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 -- http://mail.python.org/mailman/listinfo/python-list