| 1 |
import sys |
| 2 |
from _queue import Empty as Empty, SimpleQueue as SimpleQueue |
| 3 |
from _typeshed import SupportsRichComparisonT |
| 4 |
from threading import Condition, Lock |
| 5 |
from types import GenericAlias |
| 6 |
from typing import Any, Generic, TypeVar |
| 7 |
|
| 8 |
__all__ = ["Empty", "Full", "Queue", "PriorityQueue", "LifoQueue", "SimpleQueue"] |
| 9 |
if sys.version_info >= (3, 13): |
| 10 |
__all__ += ["ShutDown"] |
| 11 |
|
| 12 |
_T = TypeVar("_T") |
| 13 |
|
| 14 |
class Full(Exception): ... |
| 15 |
|
| 16 |
if sys.version_info >= (3, 13): |
| 17 |
class ShutDown(Exception): ... |
| 18 |
|
| 19 |
class Queue(Generic[_T]): |
| 20 |
maxsize: int |
| 21 |
|
| 22 |
mutex: Lock |
| 23 |
not_empty: Condition |
| 24 |
not_full: Condition |
| 25 |
all_tasks_done: Condition |
| 26 |
unfinished_tasks: int |
| 27 |
if sys.version_info >= (3, 13): |
| 28 |
is_shutdown: bool |
| 29 |
|
| 30 |
|
| 31 |
queue: Any |
| 32 |
def __init__(self, maxsize: int = 0) -> None: ... |
| 33 |
def _init(self, maxsize: int) -> None: ... |
| 34 |
def empty(self) -> bool: ... |
| 35 |
def full(self) -> bool: ... |
| 36 |
def get(self, block: bool = True, timeout: float | None = None) -> _T: ... |
| 37 |
def get_nowait(self) -> _T: ... |
| 38 |
if sys.version_info >= (3, 13): |
| 39 |
def shutdown(self, immediate: bool = False) -> None: ... |
| 40 |
|
| 41 |
def _get(self) -> _T: ... |
| 42 |
def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... |
| 43 |
def put_nowait(self, item: _T) -> None: ... |
| 44 |
def _put(self, item: _T) -> None: ... |
| 45 |
def join(self) -> None: ... |
| 46 |
def qsize(self) -> int: ... |
| 47 |
def _qsize(self) -> int: ... |
| 48 |
def task_done(self) -> None: ... |
| 49 |
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... |
| 50 |
|
| 51 |
class PriorityQueue(Queue[SupportsRichComparisonT]): |
| 52 |
queue: list[SupportsRichComparisonT] |
| 53 |
|
| 54 |
class LifoQueue(Queue[_T]): |
| 55 |
queue: list[_T] |