Skip to content

Commit 5b6afbb

Browse files
Add regression test
1 parent 49ffaea commit 5b6afbb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_frame.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ def f():
346346
self.assertEqual(x, 2)
347347
self.assertEqual(y, 3)
348348

349+
def test_closure_with_inline_comprehension(self):
350+
lambda: k
351+
k = 1
352+
lst = [locals() for k in [0]]
353+
self.assertEqual(lst[0]['k'], 0)
354+
349355
def test_as_dict(self):
350356
x = 1
351357
y = 2

0 commit comments

Comments
 (0)