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

Function _find_leanpy_helper

lean_py/_runtime.py:261–281  ·  view source on GitHub ↗

Find a `leanpy_*` helper symbol in any registered library. Caches the result to avoid repeated dlsym calls.

(self, name)

Source from the content-addressed store, hash-verified

259 self._helper_cache.clear()
260
261 def _find_leanpy_helper(self, name):
262 """Find a `leanpy_*` helper symbol in any registered library.
263 Caches the result to avoid repeated dlsym calls."""
264 if not hasattr(self, "_helper_cache"):
265 self._helper_cache = {}
266 if name in self._helper_cache:
267 return self._helper_cache[name]
268 for h in self._extra_handles:
269 try:
270 fn = getattr(h, name)
271 self._helper_cache[name] = fn
272 return fn
273 except AttributeError:
274 continue
275 try:
276 fn = getattr(self.lib, name)
277 self._helper_cache[name] = fn
278 return fn
279 except AttributeError:
280 self._helper_cache[name] = None
281 return None
282
283 def _bind_exported(self, lib):
284 for func in model.exported_functions:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected