-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy path__init__.pyi
More file actions
68 lines (60 loc) · 2.39 KB
/
Copy path__init__.pyi
File metadata and controls
68 lines (60 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import sys
import threading
import types
from collections.abc import Callable
from typing import Any, Literal, ParamSpec, TypeVar
from typing_extensions import Self
if sys.version_info >= (3, 14): # needed to satisfy pyright checks for Python <= 3.13
from _interpreters import (
InterpreterError as InterpreterError,
InterpreterNotFoundError as InterpreterNotFoundError,
NotShareableError as NotShareableError,
_SharedDict,
_Whence,
is_shareable as is_shareable,
)
from ._queues import Queue as Queue, QueueEmpty as QueueEmpty, QueueFull as QueueFull, create as create_queue
__all__ = [
"ExecutionFailed",
"Interpreter",
"InterpreterError",
"InterpreterNotFoundError",
"NotShareableError",
"Queue",
"QueueEmpty",
"QueueFull",
"create",
"create_queue",
"get_current",
"get_main",
"is_shareable",
"list_all",
]
_R = TypeVar("_R")
_P = ParamSpec("_P")
class ExecutionFailed(InterpreterError):
excinfo: types.SimpleNamespace
def __init__(self, excinfo: types.SimpleNamespace) -> None: ...
def create() -> Interpreter: ...
def list_all() -> list[Interpreter]: ...
def get_current() -> Interpreter: ...
def get_main() -> Interpreter: ...
class Interpreter:
def __new__(cls, id: int, /, _whence: _Whence | None = None, _ownsref: bool | None = None) -> Self: ...
def __reduce__(self) -> tuple[type[Self], int]: ...
def __hash__(self) -> int: ...
def __del__(self) -> None: ...
@property
def id(self) -> int: ...
@property
def whence(
self,
) -> Literal["unknown", "runtime init", "legacy C-API", "C-API", "cross-interpreter C-API", "_interpreters module"]: ...
def is_running(self) -> bool: ...
def close(self) -> None: ...
def prepare_main(
self, ns: _SharedDict | None = None, /, **kwargs: Any
) -> None: ... # kwargs has same value restrictions as _SharedDict
def exec(self, code: str | types.CodeType | Callable[[], object], /) -> None: ...
def call(self, callable: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
def call_in_thread(self, callable: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> threading.Thread: ...