* leanpy_is_lean_obj_handle: Python-side helper to check whether a * lean_object* (seen through the Py external class) wraps a LeanObjHandle. * Returns the inner lean_object* pointer value, or 0 if not a handle. */
| 1240 | lean_object *some = lean_alloc_ctor(1, 1, 0); |
| 1241 | lean_ctor_set(some, 0, result); |
| 1242 | return lean_io_result_mk_ok(some); |
| 1243 | } |
| 1244 | |
| 1245 | /* |
| 1246 | * leanpy_is_lean_obj_handle: Python-side helper to check whether a |
| 1247 | * lean_object* (seen through the Py external class) wraps a LeanObjHandle. |
| 1248 | * Returns the inner lean_object* pointer value, or 0 if not a handle. |
| 1249 | */ |
| 1250 | LEAN_EXPORT uintptr_t leanpy_is_lean_obj_handle(b_lean_obj_arg py_ext) { |
| 1251 | if (!py_initialized || !lean_is_external(py_ext)) return 0; |
| 1252 | PyObject *pyobj = unwrap_pyobject(py_ext); |
| 1253 | if (!pyobj) return 0; |
| 1254 | PyObject *ht = get_lean_obj_handle_type(); |
nothing calls this directly
no test coverage detected