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

Function lean_py_hasattr

LeanPy/native/python_bridge.c:640–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638 (void)world; ENSURE_INIT(); WITH_GIL();
639 return ok_owned_or_err(p_PyObject_GetAttrString(unwrap_pyobject(p), lean_string_cstr(name)));
640}
641
642LEAN_EXPORT lean_obj_res lean_py_setattr(b_lean_obj_arg p, b_lean_obj_arg name, b_lean_obj_arg v, lean_obj_arg world) {
643 (void)world; ENSURE_INIT(); WITH_GIL();
644 int r = p_PyObject_SetAttrString(unwrap_pyobject(p), lean_string_cstr(name), unwrap_pyobject(v));
645 if (r != 0) return raise_py_error();
646 return lean_io_result_mk_ok(lean_box(0));
647}

Callers

nothing calls this directly

Calls 3

unwrap_pyobjectFunction · 0.85
lean_string_cstrFunction · 0.85
lean_boxFunction · 0.85

Tested by

no test coverage detected