MCPcopy Create free account
hub / github.com/pybind/pybind11 / main

Method main

include/pybind11/subinterpreter.h:192–197  ·  view source on GitHub ↗

Get a handle to the main interpreter that can be used with subinterpreter_scoped_activate Note that destructing the handle is a noop, the main interpreter can only be ended by py::finalize_interpreter()

Source from the content-addressed store, hash-verified

190 /// Note that destructing the handle is a noop, the main interpreter can only be ended by
191 /// py::finalize_interpreter()
192 static subinterpreter main() {
193 subinterpreter m;
194 m.istate_ = PyInterpreterState_Main();
195 m.disarm(); // make destruct a noop
196 return m;
197 }
198
199 /// Get a non-owning wrapper of the currently active interpreter (if any)
200 static subinterpreter current() {

Callers

nothing calls this directly

Calls 1

disarmMethod · 0.45

Tested by

no test coverage detected