diff --git a/stdlib/_interpqueues.pyi b/stdlib/_interpqueues.pyi index db5e4cff5068..c9323b106f3d 100644 --- a/stdlib/_interpqueues.pyi +++ b/stdlib/_interpqueues.pyi @@ -1,16 +1,19 @@ -from typing import Any, SupportsIndex +from typing import Any, Literal, SupportsIndex +from typing_extensions import TypeAlias + +_UnboundOp: TypeAlias = Literal[1, 2, 3] class QueueError(RuntimeError): ... class QueueNotFoundError(QueueError): ... def bind(qid: SupportsIndex) -> None: ... -def create(maxsize: SupportsIndex, fmt: SupportsIndex) -> int: ... +def create(maxsize: SupportsIndex, fmt: SupportsIndex, unboundop: _UnboundOp) -> int: ... def destroy(qid: SupportsIndex) -> None: ... -def get(qid: SupportsIndex) -> tuple[Any, int]: ... +def get(qid: SupportsIndex) -> tuple[Any, int, _UnboundOp | None]: ... def get_count(qid: SupportsIndex) -> int: ... def get_maxsize(qid: SupportsIndex) -> int: ... -def get_queue_defaults(qid: SupportsIndex) -> tuple[int]: ... +def get_queue_defaults(qid: SupportsIndex) -> tuple[int, _UnboundOp]: ... def is_full(qid: SupportsIndex) -> bool: ... -def list_all() -> list[tuple[int, int]]: ... -def put(qid: SupportsIndex, obj: Any, fmt: SupportsIndex) -> None: ... +def list_all() -> list[tuple[int, int, _UnboundOp]]: ... +def put(qid: SupportsIndex, obj: Any, fmt: SupportsIndex, unboundop: _UnboundOp) -> None: ... def release(qid: SupportsIndex) -> None: ... diff --git a/stdlib/_interpreters.pyi b/stdlib/_interpreters.pyi index a57ef13c6d0f..caa1115e9d3d 100644 --- a/stdlib/_interpreters.pyi +++ b/stdlib/_interpreters.pyi @@ -21,7 +21,9 @@ def get_main() -> tuple[int, int]: ... def is_running(id: SupportsIndex, *, restrict: bool = False) -> bool: ... def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleNamespace: ... def whence(id: SupportsIndex) -> int: ... -def exec(id: SupportsIndex, code: str, shared: bool | None = None, *, restrict: bool = False) -> None: ... +def exec( + id: SupportsIndex, code: str | types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False +) -> None | types.SimpleNamespace: ... def call( id: SupportsIndex, callable: Callable[..., object],