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

Function python_import

Singular/dyn_modules/pyobject/pyobject.cc:478–491  ·  view source on GitHub ↗

import python module and export identifiers in Singular namespace

Source from the content-addressed store, hash-verified

476
477/// import python module and export identifiers in Singular namespace
478BOOLEAN python_import(leftv result, leftv value)
479{
480 if ((value == NULL) || (value->Typ()!= STRING_CMD))
481 {
482 WerrorS("expected python_import('string')");
483 return TRUE;
484 }
485
486 from_module_import_all(reinterpret_cast<const char*>(value->Data()));
487 sync_contexts();
488
489 Py_INCREF(Py_None);
490 return PythonCastStatic<>(Py_None).assign_to(result);
491}
492
493/// blackbox support - initialization
494void* pyobject_Init(blackbox*)

Callers

nothing calls this directly

Calls 6

WerrorSFunction · 0.85
from_module_import_allFunction · 0.85
sync_contextsFunction · 0.85
assign_toMethod · 0.80
TypMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected