| 572 | /* ------------------------------------------------------------------ */ |
| 573 | /* Conversions: Python → Lean */ |
| 574 | /* ------------------------------------------------------------------ */ |
| 575 | |
| 576 | LEAN_EXPORT lean_obj_res lean_py_to_bool(b_lean_obj_arg p, lean_obj_arg world) { |
| 577 | (void)world; ENSURE_INIT(); WITH_GIL(); |
| 578 | int r = p_PyObject_IsTrue(unwrap_pyobject(p)); |
| 579 | if (r < 0) return raise_py_error(); |
| 580 | return lean_io_result_mk_ok(lean_box(r ? 1 : 0)); |
| 581 | } |
| 582 |
nothing calls this directly
no test coverage detected