[issue36697] inspect.getclosurevars returns wrong globals dict

2019-04-23 Thread Noitul
Noitul added the comment: Look at this https://github.com/python/cpython/blob/3.6/Lib/inspect.py#L1412 We are taking names from func.__code__.co_names, which also contains names of object's attributes we visited. As a result, we may get more names unexpectedly in 'globals',

[issue36697] inspect.getclosurevars returns wrong globals dict

2019-04-23 Thread Noitul
Noitul added the comment: Sorry for the misleading snippet above. And how about this one: >>> import inspect >>> a = 0 >>> b = 1 >>> c = 2 >>> def abc():

[issue36697] inspect.getclosurevars returns wrong globals dict

2019-04-22 Thread Noitul
New submission from Noitul : >>> import inspect >>> a = 0 >>> b = 1 >>> def abc(): >>> return a.b