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

Function lean_py_exec

LeanPy/native/python_bridge.c:747–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

745 return p_PyModule_GetDict(m); /* borrowed */
746}
747
748LEAN_EXPORT lean_obj_res lean_py_eval(b_lean_obj_arg src, lean_obj_arg world) {
749 (void)world; ENSURE_INIT(); WITH_GIL();
750 PyObject *g = get_main_globals();
751 if (!g) return raise_py_error();
752 PyObject *r = p_PyRun_StringFlags(lean_string_cstr(src), Py_eval_input, g, g, NULL);
753 return ok_owned_or_err(r);
754}
755
756LEAN_EXPORT lean_obj_res lean_py_exec(b_lean_obj_arg src, lean_obj_arg world) {
757 (void)world; ENSURE_INIT(); WITH_GIL();
758 PyObject *g = get_main_globals();

Callers

nothing calls this directly

Calls 4

get_main_globalsFunction · 0.85
raise_py_errorFunction · 0.85
lean_string_cstrFunction · 0.85
lean_boxFunction · 0.85

Tested by

no test coverage detected