MCPcopy 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
21def _ref(value, ondel):
22 try:
23 vref = ref(value, ondel)
24 except:
25 vref = lambda:value
26 return vref
27
28class weakmap(object):
29 def __init__(self):

Callers 2

setMethod · 0.85
setMethod · 0.85

Calls 1

refClass · 0.85

Tested by

no test coverage detected