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

Function lean_box

lean_py/_runtime.py:333–338  ·  view source on GitHub ↗
(self, n)

Source from the content-addressed store, hash-verified

331 return _ptr_int(o) & _SCALAR_BIT == 1
332
333 def lean_box(self, n):
334 if isinstance(n, int):
335 ptr_val = (n << 1) | 1
336 else:
337 ptr_val = (_ptr_int(n) << 1) | 1
338 return ctypes.cast(c_void_p(ptr_val), LeanObjectPtr)
339
340 def lean_unbox(self, o):
341 return _ptr_int(o) >> 1

Callers 14

leanpy_keep_aliveFunction · 0.85
leanpy_debug_rcFunction · 0.85
leanpy_boxFunction · 0.85
lean_py_initializeFunction · 0.85
lean_py_is_initializedFunction · 0.85
lean_py_to_boolFunction · 0.85
lean_py_setattrFunction · 0.85
lean_py_hasattrFunction · 0.85
lean_py_setitemFunction · 0.85
lean_py_eqFunction · 0.85
lean_py_isFunction · 0.85
lean_py_execFunction · 0.85

Calls 1

_ptr_intFunction · 0.85

Tested by

no test coverage detected