Nick Coghlan <ncogh...@gmail.com> added the comment:
Thanks Guido. The former test cases that the new PR removes are the following: res = [i := i for i in range(5)] res = [i := 0 for i, j in [(1, 2), (3, 4)]] res = [(i := 0, j := 1) for i, j in [(1, 2), (3, 4)]] res = [(i := i, j := j) for i, j in [(1, 2), (3, 4)]] res = [(i := j, j := i) for i, j in [(1, 2), (3, 4)]] These all raise TargetScopeError with the PR applied: >>> res = [i := i for i in range(5)] File "<stdin>", line 1 TargetScopeError: named expression cannot rebind comprehension iteration variable >>> res = [i := 0 for i, j in [(1, 2), (3, 4)]] File "<stdin>", line 1 TargetScopeError: named expression cannot rebind comprehension iteration variable >>> res = [(i := 0, j := 1) for i, j in [(1, 2), (3, 4)]] File "<stdin>", line 1 TargetScopeError: named expression cannot rebind comprehension iteration variable >>> res = [(i := i, j := j) for i, j in [(1, 2), (3, 4)]] File "<stdin>", line 1 TargetScopeError: named expression cannot rebind comprehension iteration variable >>> res = [(i := j, j := i) for i, j in [(1, 2), (3, 4)]] File "<stdin>", line 1 TargetScopeError: named expression cannot rebind comprehension iteration variable ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35224> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com