| 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): |
| 9 |
x, r0 :: object |
| 10 |
L0: |
| 11 |
r0 = PyWeakref_NewRef(x, 0) |
| 12 |
return r0 |
| 13 |
|
| 14 |
[case testWeakrefRefCallback] |
| 15 |
import weakref |
| 16 |
from typing import Any, Callable |
| 17 |
def f(x: object, cb: Callable[[object], Any]) -> object: |
| 18 |
return weakref.ref(x, cb) |
| 19 |
|
| 20 |
[out] |
| 21 |
def f(x, cb): |
| 22 |
x, cb, r0 :: object |
| 23 |
L0: |
| 24 |
r0 = PyWeakref_NewRef(x, cb) |
| 25 |
return r0 |
| 26 |
|
| 27 |
[case testFromWeakrefRef] |
| 28 |
from typing import Any, Callable |
| 29 |
from weakref import ref |
| 30 |
def f(x: object) -> object: |
| 31 |
return ref(x) |
| 32 |
|
| 33 |
[out] |
| 34 |
def f(x): |
| 35 |
x, r0 :: object |
| 36 |
L0: |
| 37 |
r0 = PyWeakref_NewRef(x, 0) |
| 38 |
return r0 |
| 39 |
|
| 40 |
[case testFromWeakrefRefCallback] |
| 41 |
from typing import Any, Callable |
| 42 |
from weakref import ref |
| 43 |
def f(x: object, cb: Callable[[object], Any]) -> object: |
| 44 |
return ref(x, cb) |
| 45 |
|
| 46 |
[out] |
| 47 |
def f(x, cb): |
| 48 |
x, cb, r0 :: object |
| 49 |
L0: |
| 50 |
r0 = PyWeakref_NewRef(x, cb) |
| 51 |
return r0 |
| 52 |
|
| 53 |
[case testWeakrefProxy] |
| 54 |
import weakref |
| 55 |
from typing import Any, Callable |
| 56 |
def f(x: object) -> object: |
| 57 |
return weakref.proxy(x) |
| 58 |
|
| 59 |
[out] |
| 60 |
def f(x): |
| 61 |
x, r0 :: object |
| 62 |
L0: |
| 63 |
r0 = PyWeakref_NewProxy(x, 0) |
| 64 |
return r0 |
| 65 |
|
| 66 |
[case testWeakrefProxyCallback] |
| 67 |
import weakref |
| 68 |
from typing import Any, Callable |
| 69 |
def f(x: object, cb: Callable[[object], Any]) -> object: |
| 70 |
return weakref.proxy(x, cb) |
| 71 |
|
| 72 |
[out] |
| 73 |
def f(x, cb): |
| 74 |
x, cb, r0 :: object |
| 75 |
L0: |
| 76 |
r0 = PyWeakref_NewProxy(x, cb) |
| 77 |
return r0 |
| 78 |
|
| 79 |
[case testFromWeakrefProxy] |
| 80 |
from typing import Any, Callable |
| 81 |
from weakref import proxy |
| 82 |
def f(x: object) -> object: |
| 83 |
return proxy(x) |
| 84 |
|
| 85 |
[out] |
| 86 |
def f(x): |
| 87 |
x, r0 :: object |
| 88 |
L0: |
| 89 |
r0 = PyWeakref_NewProxy(x, 0) |
| 90 |
return r0 |
| 91 |
|
| 92 |
[case testFromWeakrefProxyCallback] |
| 93 |
from typing import Any, Callable |
| 94 |
from weakref import proxy |
| 95 |
def f(x: object, cb: Callable[[object], Any]) -> object: |
| 96 |
return proxy(x, cb) |
| 97 |
|
| 98 |
[out] |
| 99 |
def f(x, cb): |
| 100 |
x, cb, r0 :: object |
| 101 |
L0: |
| 102 |
r0 = PyWeakref_NewProxy(x, cb) |
| 103 |
return r0 |