MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / lean_py_to_int64

Function lean_py_to_int64

LeanPy/native/python_bridge.c:574–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572/* ------------------------------------------------------------------ */
573/* Conversions: Python → Lean */
574/* ------------------------------------------------------------------ */
575
576LEAN_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

Callers

nothing calls this directly

Calls 3

unwrap_pyobjectFunction · 0.85
raise_py_errorFunction · 0.85
lean_int64_to_intFunction · 0.85

Tested by

no test coverage detected