Author Noitul
Recipients Noitul, eric.smith, nitishch, yselivanov
Date 2019-04-24.01:50:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556070624.84.0.577742168334.issue36697@roundup.psfhosted.org>
In-reply-to
Content
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', 'builtins', and even 'unbound'.

And this example might be another case of this potentially bug

>>> import inspect
>>> def abc():
...     import os
...     sys = None
... 
>>> inspect.getclosurevars(abc)
ClosureVars(nonlocals={}, globals={}, builtins={}, unbound={'os'})
History
Date User Action Args
2019-04-24 01:50:24Noitulsetrecipients: + Noitul, eric.smith, yselivanov, nitishch
2019-04-24 01:50:24Noitulsetmessageid: <1556070624.84.0.577742168334.issue36697@roundup.psfhosted.org>
2019-04-24 01:50:24Noitullinkissue36697 messages
2019-04-24 01:50:24Noitulcreate