MCPcopy Index your code
hub / github.com/python/cpython / _cb

Method _cb

Lib/weakref.py:53–60  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

51 raise TypeError("argument should be a bound method, not {}"
52 .format(type(meth))) from None
53 def _cb(arg):
54 # The self-weakref trick is needed to avoid creating a reference
55 # cycle.
56 self = self_wr()
57 if self._alive:
58 self._alive = False
59 if callback is not None:
60 callback(self)
61 self = ref.__new__(cls, obj, _cb)
62 self._func_ref = ref(func, _cb)
63 self._meth_type = type(meth)

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.70

Tested by

no test coverage detected