mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-104615: don't make unsafe swaps in apply_static_swaps (#104620)
This commit is contained in:
parent
dcdc90d384
commit
0589c6a4d3
14 changed files with 95 additions and 20 deletions
|
@ -484,6 +484,12 @@ class ListComprehensionTest(unittest.TestCase):
|
|||
"""
|
||||
self._check_in_scopes(code, {"z": 1, "out": [(3, 2, 1)]})
|
||||
|
||||
def test_assign_to_comp_iter_var_in_outer_function(self):
|
||||
code = """
|
||||
a = [1 for a in [0]]
|
||||
"""
|
||||
self._check_in_scopes(code, {"a": [1]}, scopes=["function"])
|
||||
|
||||
|
||||
__test__ = {'doctests' : doctests}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue