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

Function lean_py_of_bytes

LeanPy/native/python_bridge.c:508–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506 (void)world; ENSURE_INIT(); WITH_GIL();
507 return ok_owned_or_err(p_PyFloat_FromDouble(f));
508}
509
510LEAN_EXPORT lean_obj_res lean_py_of_string(b_lean_obj_arg s, lean_obj_arg world) {
511 (void)world; ENSURE_INIT(); WITH_GIL();
512 const char *cs = lean_string_cstr(s);
513 size_t n = lean_string_size(s) - 1; /* size includes terminating NUL */
514 return ok_owned_or_err(p_PyUnicode_DecodeUTF8(cs, (Py_ssize_t)n, NULL));
515}
516

Callers

nothing calls this directly

Calls 1

ok_owned_or_errFunction · 0.85

Tested by

no test coverage detected