MCPcopy Create free account
hub / github.com/Singular/Singular / names_from_module

Function names_from_module

Singular/dyn_modules/pyobject/pyobject.cc:459–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459PythonObject names_from_module(const char* module_name)
460{
461 char buffer[strlen(module_name) + 30];
462 snprintf (buffer,strlen(module_name) + 30, "SINGULAR_MODULE_NAME = '%s'", module_name);
463 PyRun_SimpleString(buffer);
464 PyRun_SimpleString("from sys import modules");
465 PyRun_SimpleString("exec('from ' + SINGULAR_MODULE_NAME + ' import *')");
466
467 return python_eval("[str for str in dir(modules[SINGULAR_MODULE_NAME]) if str[0] != '_']");
468}
469
470void from_module_import_all(const char* module_name)
471{

Callers

nothing calls this directly

Calls 1

python_evalFunction · 0.85

Tested by

no test coverage detected