[issue41216] eval don't load local variable in dict and list comprehensions.

2020-07-06 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed that this is a duplicate, so I'm closing it. -- nosy: +eric.smith resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> eval() function in List Comprehension doesn't work ___ Pyt

[issue41216] eval don't load local variable in dict and list comprehensions.

2020-07-05 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This seems to be a duplicate of issue5242, issue36300 -- nosy: +xtreak ___ Python tracker ___ _

[issue41216] eval don't load local variable in dict and list comprehensions.

2020-07-05 Thread Andrej Klychin
New submission from Andrej Klychin : I'm not sure is it a bug or a fecature of comprehensions or eval, but intuitively it seems like it should work. def foo(baz): return eval("[baz for _ in range(10)]") foo(3) Traceback (most recent call last): File "", line 1, in File "", line 2, in