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

Function lean_py_setitem

LeanPy/native/python_bridge.c:651–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649LEAN_EXPORT lean_obj_res lean_py_hasattr(b_lean_obj_arg p, b_lean_obj_arg name, lean_obj_arg world) {
650 (void)world; ENSURE_INIT(); WITH_GIL();
651 int r = p_PyObject_HasAttrString(unwrap_pyobject(p), lean_string_cstr(name));
652 return lean_io_result_mk_ok(lean_box(r ? 1 : 0));
653}
654
655LEAN_EXPORT lean_obj_res lean_py_getitem(b_lean_obj_arg p, b_lean_obj_arg k, lean_obj_arg world) {
656 (void)world; ENSURE_INIT(); WITH_GIL();
657 return ok_owned_or_err(p_PyObject_GetItem(unwrap_pyobject(p), unwrap_pyobject(k)));
658}
659

Callers

nothing calls this directly

Calls 3

unwrap_pyobjectFunction · 0.85
raise_py_errorFunction · 0.85
lean_boxFunction · 0.85

Tested by

no test coverage detected