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

Function lean_py_length

LeanPy/native/python_bridge.c:658–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656 (void)world; ENSURE_INIT(); WITH_GIL();
657 return ok_owned_or_err(p_PyObject_GetItem(unwrap_pyobject(p), unwrap_pyobject(k)));
658}
659
660LEAN_EXPORT lean_obj_res lean_py_setitem(b_lean_obj_arg p, b_lean_obj_arg k, b_lean_obj_arg v, lean_obj_arg world) {
661 (void)world; ENSURE_INIT(); WITH_GIL();
662 int r = p_PyObject_SetItem(unwrap_pyobject(p), unwrap_pyobject(k), unwrap_pyobject(v));
663 if (r != 0) return raise_py_error();
664 return lean_io_result_mk_ok(lean_box(0));
665}
666

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