Skip to content

Commit 1c96658

Browse files
committed
finalize PR
1 parent 9d6c52c commit 1c96658

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

mypyc/primitives/weakref_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
new_proxy_with_callback_op = function_op(
3434
name="_weakref.proxy",
3535
arg_types=[object_rprimitive, object_rprimitive],
36-
steals=[True, False],
36+
#steals=[True, False],
3737
return_type=object_rprimitive,
3838
c_function_name="PyWeakref_NewProxy",
3939
error_kind=ERR_MAGIC,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class dict: ...
2+
class ellipsis: ...
3+
class int: ...
4+
class str: ...
5+
class tuple: ...
6+
class type: ...
7+
class list: ...
8+
class BaseException: ...
9+
class Exception(BaseException): ...
10+
class ReferenceError(Exception): ...

mypyc/test-data/run-weakref.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ def test_weakref_proxy():
5858
p = proxy(obj)
5959
assert obj.some_meth() == 1
6060
assert p.some_meth() == 1
61+
obj.some_meth()
6162
obj = None
6263
with pytest.raises(ReferenceError):
6364
p.some_meth()
6465

66+
[builtins fixtures/test-weakref.pyi]
6567
[file driver.py]
6668
from native import test_weakref_proxy
6769

@@ -84,10 +86,12 @@ def test_weakref_proxy_with_callback():
8486
p = proxy(obj, lambda x: x)
8587
assert obj.some_meth() == 1
8688
assert p.some_meth() == 1
89+
obj.some_meth()
8790
obj = None
8891
with pytest.raises(ReferenceError):
8992
p.some_meth()
9093

94+
[builtins fixtures/test-weakref.pyi]
9195
[file driver.py]
9296
from native import test_weakref_proxy_with_callback
9397

0 commit comments

Comments
 (0)