[issue18110] Nested set comprehensions in class scope fail

2013-06-10 Thread Eric Wieser
Eric Wieser added the comment: Thanks for the clarification - this behavior now makes perfect sense to me. As expected, swapping the list comprehension for a generator comprehension, or vice versa, prevents the error. -- ___ Python tracker

[issue18110] Nested set comprehensions in class scope fail

2013-06-10 Thread Mark Dickinson
Mark Dickinson added the comment: "won't fix" is probably a better resolution. But in the absence of that apostrophe-rich option, I'll use "wont fix" instead. -- resolution: invalid -> wont fix ___ Python tracker

[issue18110] Nested set comprehensions in class scope fail

2013-06-10 Thread Mark Dickinson
Mark Dickinson added the comment: While I agree that this isn't an exact duplicate of #3692, the underlying cause is the same, and Python is working as designed and documented in this case. In Python 2, list comprehensions don't have their own scope, so the `x` in your initial example lives at

[issue18110] Nested set comprehensions in class scope fail

2013-06-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue18110] Nested set comprehensions in class scope fail

2013-06-01 Thread Eric Wieser
Changes by Eric Wieser : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue18110] Nested set comprehensions in class scope fail

2013-06-01 Thread Eric Wieser
Eric Wieser added the comment: This is not at first glance, a duplicate of 3692 - in that case, the list comprehension is referring to another class variable. Most notably, that describes a behavioural change introduced by python 3 - in this case, python 3 handles it correctly - there's a bug

[issue18110] Nested set comprehensions in class scope fail

2013-05-31 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> duplicate status: open -> closed superseder: -> improper scope in list comprehension, when used in class declaration ___ Python tracker __

[issue18110] Nested set comprehensions in class scope fail

2013-05-31 Thread Dmi Baranov
Changes by Dmi Baranov : -- nosy: +dmi.baranov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue18110] Nested set comprehensions in class scope fail

2013-05-31 Thread Eric Wieser
New submission from Eric Wieser: This code: class Sudoku(dict): COLUMNS = [ {(x, y) for y in xrange(9)} for x in xrange(9) ] When run on Python 2.7.5, fails with this traceback: Traceback (most recent call last): File "", line 1, in class Sudo