Skip to content

Commit 9f106c0

Browse files
Update irbuild-weakref.test
1 parent 8a6e819 commit 9f106c0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

mypyc/test-data/irbuild-weakref.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
[case testWeakrefRef]
22
from typing import Any, Callable
33
from weakref import ref
4+
def f(x: object) -> object:
5+
return ref(x)
6+
7+
[out]
8+
def f(x):
9+
x :: object
10+
r0 :: object
11+
L0:
12+
r0 = PyWeakref_NewRef(x, NULL)
13+
return r0
14+
15+
[case testWeakrefRefCallback]
16+
from typing import Any, Callable
17+
from weakref import ref
418
def f(x: object, cb: Callable[[object], Any]) -> object:
519
return ref(x, cb)
620

@@ -15,6 +29,20 @@ L0:
1529
[case testWeakrefProxy]
1630
from typing import Any, Callable
1731
from weakref import proxy
32+
def f(x: object) -> object:
33+
return proxy(x)
34+
35+
[out]
36+
def f(x):
37+
x :: object
38+
r0 :: object
39+
L0:
40+
r0 = PyWeakref_NewProxy(x, NULL)
41+
return r0
42+
43+
[case testWeakrefProxyCallback]
44+
from typing import Any, Callable
45+
from weakref import proxy
1846
def f(x: object, cb: Callable[[object], Any]) -> object:
1947
return proxy(x, cb)
2048

0 commit comments

Comments
 (0)