Skip to main content

Module interpreter

Module interpreter 

Source
Expand description

Embedded interpreter lifecycle.

Fidius-python links libpython through PyO3’s auto-initialize feature. The interpreter is brought up lazily on first use and lives for the remainder of the host process — fidius does not currently support tearing it down or reinitialising it. This matches cloacina’s pattern.

All Python work is gated by PyO3’s Python::with_gil, which is the correct concurrency primitive for embedded interpreters: there is no separate Mutex<PyInterpreter> to manage.

Functions§

ensure_initialized
Idempotent: ensure the embedded Python interpreter is initialised.