[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Emmanuel Arias
Emmanuel Arias added the comment: I don't know if this a bug for py3 or py2 because the the w variable is not defined on the list comprehension context. Maybe the locals on `eval` must be create w on locals context -- type: -> behavior versions: +Python 2.7 _

[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Emmanuel Arias
Emmanuel Arias added the comment: I test it on 3.7 and 3.8 and have the same problem -- nosy: +eamanu versions: +Python 3.7, Python 3.8 ___ Python tracker ___

[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Martin Hosken
Change by Martin Hosken : -- versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Martin Hosken
New submission from Martin Hosken : The following code fails: >>> lcls = {'w': 100} >>> eval('[w for x in ("hello", "world")]', None, lcls) Traceback (most recent call last): File "", line 1, in File "", line 1, in File "", line 1, in NameError: name 'w' is