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

Function lean_py_eval

LeanPy/native/python_bridge.c:739–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737LEAN_EXPORT lean_obj_res lean_py_import(b_lean_obj_arg name, lean_obj_arg world) {
738 (void)world; ENSURE_INIT(); WITH_GIL();
739 return ok_owned_or_err(p_PyImport_ImportModule(lean_string_cstr(name)));
740}
741
742static PyObject *get_main_globals(void) {
743 PyObject *m = p_PyImport_AddModule("__main__"); /* borrowed */
744 if (!m) return NULL;
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) {

Callers

nothing calls this directly

Calls 4

get_main_globalsFunction · 0.85
raise_py_errorFunction · 0.85
lean_string_cstrFunction · 0.85
ok_owned_or_errFunction · 0.85

Tested by

no test coverage detected