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 fork is not universally guaranteed. Rather than let these manifest as opaque crashes or silent state loss, this contract declares them explicitly so callers (and check_runtime_supported) can branch and fail fast with a clear message.

Parameters:
gil_enabledbool

Whether the GIL is currently enabled. False on 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 fork after loading an extension is supported (POSIX only; the child must not rely on threads created pre-fork).

platformstr

The value of sys.platform.

Parameters:
  • gil_enabled (bool)

  • free_threaded_build (bool)

  • in_main_interpreter (bool)

  • supports_unload (bool)

  • supports_fork_after_load (bool)

  • platform (str)

See also

runtime_capabilities

Construct the contract for the current process.

check_runtime_supported

Fail fast on an unsupported configuration.

count(value, /)#

Return number of occurrences of value.

free_threaded_build: bool[source]#

Alias for field number 1

gil_enabled: bool[source]#

Alias for field number 0

in_main_interpreter: bool[source]#

Alias for field number 2

index(value, start=0, stop=sys.maxsize, /)#

Return first index of value.

Raises ValueError if the value is not present.

platform: str[source]#

Alias for field number 5

supports_fork_after_load: bool[source]#

Alias for field number 4

supports_unload: bool[source]#

Alias for field number 3