Skip to content

Commit 8d9bf06

Browse files
committed
Add callback argument to weakref.proxy
1 parent 4a96595 commit 8d9bf06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/lib-graalpython/_weakref.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def _proxy_get(proxy):
4949

5050

5151
class ProxyType(object):
52-
def __init__(self, other):
52+
def __init__(self, other, callback=None):
5353
import weakref
54-
object.__setattr__(self, "_weakref", weakref.ref(other))
54+
object.__setattr__(self, "_weakref", weakref.ref(other, callback))
5555

5656
def __getattribute__(self, key):
5757
return getattr(_proxy_get(self), key)

0 commit comments

Comments
 (0)