massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / queue.pyi
1 import sys
2 from threading import Condition, Lock
3 from typing import Any, Generic, TypeVar
4
5 if sys.version_info >= (3, 9):
6     from types import GenericAlias
7
8 _T = TypeVar("_T")
9
10 class Empty(Exception): ...
11 class Full(Exception): ...
12
13 class Queue(Generic[_T]):
14     maxsize: int
15
16     mutex: Lock  # undocumented
17     not_empty: Condition  # undocumented
18     not_full: Condition  # undocumented
19     all_tasks_done: Condition  # undocumented
20     unfinished_tasks: int  # undocumented
21     queue: Any  # undocumented
22     def __init__(self, maxsize: int = ...) -> None: ...
23     def _init(self, maxsize: int) -> None: ...
24     def empty(self) -> bool: ...
25     def full(self) -> bool: ...
26     def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ...
27     def get_nowait(self) -> _T: ...
28     def _get(self) -> _T: ...
29     def put(self, item: _T, block: bool = ..., timeout: float | None = ...) -> None: ...
30     def put_nowait(self, item: _T) -> None: ...
31     def _put(self, item: _T) -> None: ...
32     def join(self) -> None: ...
33     def qsize(self) -> int: ...
34     def _qsize(self) -> int: ...
35     def task_done(self) -> None: ...
36     if sys.version_info >= (3, 9):
37         def __class_getitem__(cls, item: Any) -> GenericAlias: ...
38
39 class PriorityQueue(Queue[_T]): ...
40 class LifoQueue(Queue[_T]): ...
41
42 if sys.version_info >= (3, 7):
43     class SimpleQueue(Generic[_T]):
44         def __init__(self) -> None: ...
45         def empty(self) -> bool: ...
46         def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ...
47         def get_nowait(self) -> _T: ...
48         def put(self, item: _T, block: bool = ..., timeout: float | None = ...) -> None: ...
49         def put_nowait(self, item: _T) -> None: ...
50         def qsize(self) -> int: ...
51         if sys.version_info >= (3, 9):
52             def __class_getitem__(cls, item: Any) -> GenericAlias: ...