| 42 | borrow<callable>((PyObject *) context)(arg); |
| 43 | } |
| 44 | bool from_python(handle src, uint8_t, cleanup_list*) noexcept { |
| 45 | if (!isinstance<callable>(src)) return false; |
| 46 | value = {(void *) src.ptr(), &wrap_call}; |
| 47 | return true; |
| 48 | } |
| 49 | static handle from_cpp(callback cb, rv_policy policy, cleanup_list*) noexcept { |
| 50 | if (cb.func == &wrap_call) |
| 51 | return handle((PyObject *) cb.context).inc_ref(); |