RuntimeCapabilities#
- class scikitplot.cython.RuntimeCapabilities(gil_enabled, free_threaded_build, in_main_interpreter, supports_unload, supports_fork_after_load, platform)[source]#
Declared contract for native-extension runtime lifecycle (CYTHON-ABI-001).
Native extensions cannot generally be unloaded safely, and behavior under a free-threaded (GIL-disabled) interpreter, a non-main subinterpreter, or after
forkis not universally guaranteed. Rather than let these manifest as opaque crashes or silent state loss, this contract declares them explicitly so callers (andcheck_runtime_supported) can branch and fail fast with a clear message.- Parameters:
- gil_enabledbool
Whether the GIL is currently enabled.
Falseon a free-threaded (Py_GIL_DISABLED) build — where thread-safety of arbitrary extensions is not guaranteed.- free_threaded_buildbool
Whether CPython was built free-threaded (
Py_GIL_DISABLED).- in_main_interpreterbool
Whether the current interpreter is the main one. Extensions without per-interpreter GIL support must not run in a subinterpreter.
- supports_unloadbool
Whether a loaded extension can be safely unloaded/replaced. Always
False: CPython cannot generally unload native modules.- supports_fork_after_loadbool
Whether
forkafter loading an extension is supported (POSIX only; the child must not rely on threads created pre-fork).- platformstr
The value of
sys.platform.
- Parameters:
See also
runtime_capabilitiesConstruct the contract for the current process.
check_runtime_supportedFail fast on an unsupported configuration.
- count(value, /)#
Return number of occurrences of value.
- index(value, start=0, stop=sys.maxsize, /)#
Return first index of value.
Raises ValueError if the value is not present.