File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
graalpython/com.oracle.graal.python.test/src/tests Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
- # Copyright (c) 2018, 2021 , Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2018, 2023 , Oracle and/or its affiliates. All rights reserved.
2
2
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
3
#
4
4
# The Universal Permissive License (UPL), Version 1.0
@@ -107,3 +107,19 @@ def do_hash(item):
107
107
assert False , "could compute hash for r3 but should have failed"
108
108
109
109
assert r1_hash == do_hash (r1 )
110
+
111
+ def test_weakref_reuse ():
112
+ from weakref import ref
113
+ class A :
114
+ pass
115
+ a = A ()
116
+ assert ref (a ) == ref (a )
117
+
118
+ def test_weakref_object_type_support ():
119
+ from weakref import ref
120
+ try :
121
+ ref (42 )
122
+ except TypeError as e :
123
+ pass
124
+ else :
125
+ assert False , "should throw TypeError for unsupported objects"
You can’t perform that action at this time.
0 commit comments