forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue.pyi
More file actions
36 lines (30 loc) · 1.13 KB
/
queue.pyi
File metadata and controls
36 lines (30 loc) · 1.13 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
# Stubs for queue
# NOTE: These are incomplete!
from threading import Lock, Condition
from typing import Any, TypeVar, Generic, Optional
_T = TypeVar('_T')
class Empty(Exception): ...
class Full(Exception): ...
class Queue(Generic[_T]):
maxsize = ... # type: int
mutex = ... # type: Lock
not_empty = ... # type: Condition
not_full = ... # type: Condition
all_tasks_done = ... # type: Condition
unfinished_tasks = ... # type: int
def __init__(self, maxsize: int = ...) -> None: ...
def _init(self, maxsize: int) -> None: ...
def empty(self) -> bool: ...
def full(self) -> bool: ...
def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ...
def get_nowait(self) -> _T: ...
def _get(self) -> _T: ...
def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ...
def put_nowait(self, item: _T) -> None: ...
def _put(self, item: _T) -> None: ...
def join(self) -> None: ...
def qsize(self) -> int: ...
def _qsize(self) -> int: ...
def task_done(self) -> None: ...
class PriorityQueue(Queue[_T]): ...
class LifoQueue(Queue[_T]): ...