| 679 | } |
| 680 | |
| 681 | LEAN_EXPORT lean_obj_res lean_py_is(b_lean_obj_arg a, b_lean_obj_arg b, lean_obj_arg world) { |
| 682 | (void)world; ENSURE_INIT(); WITH_GIL(); |
| 683 | return lean_io_result_mk_ok(lean_box(unwrap_pyobject(a) == unwrap_pyobject(b) ? 1 : 0)); |
| 684 | } |
| 685 | |
| 686 | /* ------------------------------------------------------------------ */ |
| 687 | /* Calling */ |
| 688 | /* ------------------------------------------------------------------ */ |
| 689 | |
| 690 | LEAN_EXPORT lean_obj_res lean_py_call(b_lean_obj_arg f, b_lean_obj_arg args, lean_obj_arg world) { |
| 691 | (void)world; ENSURE_INIT(); WITH_GIL(); |
| 692 | size_t n = lean_array_size(args); |
| 693 | PyObject *tup = p_PyTuple_New((Py_ssize_t)n); |
| 694 | if (!tup) return raise_py_error(); |
| 695 | for (size_t i = 0; i < n; i++) { |
| 696 | PyObject *po = unwrap_pyobject(lean_array_get_core(args, i)); |
| 697 | p_Py_IncRef(po); |
nothing calls this directly
no test coverage detected