(arg)
| 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) |
nothing calls this directly
no test coverage detected