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 1ae55e4 commit 216df5eCopy full SHA for 216df5e
mypyc/test-data/irbuild-weakref.test
@@ -1,3 +1,16 @@
1
+[case testWeakrefRef]
2
+import weakref
3
+from typing import Any, Callable
4
+def f(x: object) -> object:
5
+ return weakref.ref(x)
6
+
7
+[out]
8
+def f(x, cb):
9
+ x, r0 :: object
10
+L0:
11
+ r0 = PyWeakref_NewRef(x, NULL)
12
+ return r0
13
14
[case testWeakrefRefCallback]
15
import weakref
16
from typing import Any, Callable
@@ -11,6 +24,19 @@ L0:
24
r0 = PyWeakref_NewRef(x, cb)
25
return r0
26
27
+[case testFromWeakrefRef]
28
29
+from weakref import ref
30
31
+ return ref(x)
32
33
34
35
36
37
38
39
40
[case testFromWeakrefRefCallback]
41
42
from weakref import ref
0 commit comments