Skip to main content

main_interpreter_id

Function main_interpreter_id 

Source
pub fn main_interpreter_id() -> Option<i64>
Expand description

Id of the main interpreter (PEP 734 get_main()), or None before any interpreter has been created.

This is distinct from PyGlobalState::is_main: every top-level (non-sub) interpreter carries is_main for its own signal / main-thread bookkeeping, but only the first one registered becomes the main.