# cell 0
j = "str"
[j for j in range(1, 6)]
# cell 1
j = 3
Repro Steps
Create new notebook with two cells as shown above.
Find All References on j within the list comprehension.
Expected behavior
Only the two references within the list comprehension are provided because the list comprehension is a separate name scope. This is the behavior you'll see if all three lines are in the same cell or are in a .py file.
Actual behavior
The use of the unrelated variable (also named j) in the second cell is also included:
Environment data
Code Snippet
Repro Steps
j
within the list comprehension.Expected behavior
Only the two references within the list comprehension are provided because the list comprehension is a separate name scope. This is the behavior you'll see if all three lines are in the same cell or are in a
.py
file.Actual behavior
The use of the unrelated variable (also named
j
) in the second cell is also included: