We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 928e5a5 commit 37fc759Copy full SHA for 37fc759
mypyc/test-data/run-weakref.test
@@ -58,6 +58,10 @@ def test_weakref_proxy():
58
p = proxy(obj)
59
assert obj.some_meth() == 1
60
assert p.some_meth() == 1
61
+
62
+ # we just need to do something with `obj` down here so mypyc keeps its reference thru the above line
63
+ obj.some_meth()
64
65
obj = None
66
with pytest.raises(ReferenceError):
67
p.some_meth()
@@ -84,6 +88,10 @@ def test_weakref_proxy_with_callback():
84
88
p = proxy(obj, lambda x: x)
85
89
86
90
91
92
93
94
87
95
96
97
0 commit comments