Multiple list comprehensions on one line fail to find local variables
abrunyate opened this issue · comments
abrunyate commented
The code
def fun():
x=2
L=([x for i in range(4)], [j for j in range(4)])
fun()
does not execute, since the x
in the first comprehension is not resolved. The compiler does produce a warning, but it's hard to spot high up in the tool chain (it went unnoticed when using briefcase->android). Splitting the line, of course, fixes the problem.
I don't know enough about how VOC works yet to know how hard it would be to enhance the keys to the code object dictionary (if indeed this is the solution).