|
| 1 | +import types |
| 2 | +from collections.abc import Callable, Mapping |
| 3 | +from typing import Final, Literal, SupportsIndex |
| 4 | +from typing_extensions import TypeAlias |
| 5 | + |
| 6 | +_Configs: TypeAlias = Literal["default", "isolated", "legacy", "empty", ""] |
| 7 | + |
| 8 | +class InterpreterError(Exception): ... |
| 9 | +class InterpreterNotFoundError(InterpreterError): ... |
| 10 | +class NotShareableError(Exception): ... |
| 11 | + |
| 12 | +class CrossInterpreterBufferView: |
| 13 | + def __buffer__(self, flags: int, /) -> memoryview: ... |
| 14 | + |
| 15 | +def new_config(name: _Configs = "isolated", /, **overides: object) -> types.SimpleNamespace: ... |
| 16 | +def create(config: types.SimpleNamespace | _Configs | None = "isolated", *, reqrefs: bool = False) -> int: ... |
| 17 | +def destroy(id: SupportsIndex, *, restrict: bool = False) -> None: ... |
| 18 | +def list_all(*, require_ready: bool) -> list[tuple[int, int]]: ... |
| 19 | +def get_current() -> tuple[int, int]: ... |
| 20 | +def get_main() -> tuple[int, int]: ... |
| 21 | +def is_running(id: SupportsIndex, *, restrict: bool = False) -> bool: ... |
| 22 | +def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleNamespace: ... |
| 23 | +def whence(id: SupportsIndex) -> int: ... |
| 24 | +def exec(id: SupportsIndex, code: str, shared: bool | None = None, *, restrict: bool = False) -> None: ... |
| 25 | +def call( |
| 26 | + id: SupportsIndex, |
| 27 | + callable: Callable[..., object], |
| 28 | + args: tuple[object, ...] | None = None, |
| 29 | + kwargs: dict[str, object] | None = None, |
| 30 | + *, |
| 31 | + restrict: bool = False, |
| 32 | +) -> object: ... |
| 33 | +def run_string( |
| 34 | + id: SupportsIndex, script: str | types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False |
| 35 | +) -> None: ... |
| 36 | +def run_func( |
| 37 | + id: SupportsIndex, func: types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False |
| 38 | +) -> None: ... |
| 39 | +def set___main___attrs(id: SupportsIndex, updates: Mapping[str, object], *, restrict: bool = False) -> None: ... |
| 40 | +def incref(id: SupportsIndex, *, implieslink: bool = False, restrict: bool = False) -> None: ... |
| 41 | +def decref(id: SupportsIndex, *, restrict: bool = False) -> None: ... |
| 42 | +def is_shareable(obj: object) -> bool: ... |
| 43 | +def capture_exception(exc: BaseException | None = None) -> types.SimpleNamespace: ... |
| 44 | + |
| 45 | +WHENCE_UNKNOWN: Final = 0 |
| 46 | +WHENCE_RUNTIME: Final = 1 |
| 47 | +WHENCE_LEGACY_CAPI: Final = 2 |
| 48 | +WHENCE_CAPI: Final = 3 |
| 49 | +WHENCE_XI: Final = 4 |
| 50 | +WHENCE_STDLIB: Final = 5 |
0 commit comments