Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ _ref
Function
_ref
recipes/Python/577580_weak_reference_map/recipe-577580.py:21–26 ·
view source on GitHub ↗
(value, ondel)
Source
from the content-addressed store, hash-verified
19
20
### weak ref key holder
21
def
_ref(value, ondel):
22
try
:
23
vref = ref(value, ondel)
24
except
:
25
vref =
lambda
:value
26
return
vref
27
28
class
weakmap(object):
29
def
__init__(self):
Callers
2
set
Method · 0.85
set
Method · 0.85
Calls
1
ref
Class · 0.85
Tested by
no test coverage detected