mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Add test for a list comprehension that is nested in the left-hand part
of another list comp. This caused crashes reported as SF bugs 409230 and 407800. Note that the new tests are in a function so that the name lookup code isn't affected by how many *other* list comprehensions are in the same scope.
This commit is contained in:
parent
23b4227ec8
commit
e241e29f3d
2 changed files with 6 additions and 0 deletions
|
@ -661,6 +661,11 @@ def test_in_func(l):
|
|||
|
||||
print test_in_func(nums)
|
||||
|
||||
def test_nested_front():
|
||||
print [[y for y in [x, x + 1]] for x in [1,3,5]]
|
||||
|
||||
test_nested_front()
|
||||
|
||||
check_syntax("[i, s for i in nums for s in strs]")
|
||||
check_syntax("[x if y]")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue