Author Daniel Debrunner
Recipients Daniel Debrunner, Noitul, eric.smith, nitishch, yselivanov
Date 2019-10-07.19:07:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570475251.34.0.527321620539.issue36697@roundup.psfhosted.org>
In-reply-to
Content
Another case:

model="Hello"
class M(object):
    def __init__(self):
        pass
    def __call__(self):
        print(self.model)

cvs = inspect.getclosurevars(M.__call__)

ClosureVars(nonlocals={}, globals={'model': 'Hello'}, builtins={'print': <built-in function print>}, unbound=set())

Of course self.model does not refer to the global model
M()()
AttributeError: 'M' object has no attribute 'model'
History
Date User Action Args
2019-10-07 19:07:31Daniel Debrunnersetrecipients: + Daniel Debrunner, eric.smith, yselivanov, nitishch, Noitul
2019-10-07 19:07:31Daniel Debrunnersetmessageid: <1570475251.34.0.527321620539.issue36697@roundup.psfhosted.org>
2019-10-07 19:07:31Daniel Debrunnerlinkissue36697 messages
2019-10-07 19:07:31Daniel Debrunnercreate