Message354128
| Author | Daniel Debrunner |
|---|---|
| Recipients | Daniel Debrunner, eric.smith, llehtahw, 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:31 | Daniel Debrunner | set | recipients: + Daniel Debrunner, eric.smith, yselivanov, nitishch, llehtahw |
| 2019-10-07 19:07:31 | Daniel Debrunner | set | messageid: <1570475251.34.0.527321620539.issue36697@roundup.psfhosted.org> |
| 2019-10-07 19:07:31 | Daniel Debrunner | link | issue36697 messages |
| 2019-10-07 19:07:31 | Daniel Debrunner | create | |