File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 11[case testWeakrefRef]
22from typing import Any, Callable
33from 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
418def f(x: object, cb: Callable[[object], Any]) -> object:
519 return ref(x, cb)
620
1529[case testWeakrefProxy]
1630from typing import Any, Callable
1731from 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
1846def f(x: object, cb: Callable[[object], Any]) -> object:
1947 return proxy(x, cb)
2048
You can’t perform that action at this time.
0 commit comments