Skip to content

Commit 5aee184

Browse files
author
Vita Smid
committed
Added basic asyncio.queues stubs
1 parent 6cafa35 commit 5aee184

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

stubs/3.4/asyncio/__init__.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ from asyncio.tasks import (coroutine, sleep, Task, FIRST_COMPLETED,
44
FIRST_EXCEPTION, ALL_COMPLETED, wait, wait_for)
55
from asyncio.events import (AbstractEventLoopPolicy, AbstractEventLoop,
66
Handle, get_event_loop)
7+
from asyncio.queues import (Queue, PriorityQueue, LifoQueue, JoinableQueue,
8+
QueueFull, QueueEmpty)
79

810
__all__ = (futures.__all__,
911
tasks.__all__,
10-
events.__all__)
12+
events.__all__,
13+
queues.__all__)

stubs/3.4/asyncio/queues.pyi

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from typing import Any
2+
3+
__all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'JoinableQueue',
4+
'QueueFull', 'QueueEmpty']
5+
6+
from asyncio.events import AbstractEventLoop
7+
from .tasks import coroutine
8+
9+
10+
class QueueEmpty(Exception): ...
11+
class QueueFull(Exception): ...
12+
13+
14+
class Queue:
15+
def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop = None): ...
16+
def _init(self, maxsize: int) -> None: ...
17+
def _get(self) -> Any: ...
18+
def _put(self, item: Any) -> None: ...
19+
def __repr__(self) -> str: ...
20+
def __str__(self) -> str: ...
21+
def _format(self) -> str: ...
22+
def _consume_done_getters(self) -> None: ...
23+
def _consume_done_putters(self) -> None: ...
24+
def qsize(self) -> int: ...
25+
@property
26+
def maxsize(self) -> int: ...
27+
def empty(self) -> bool: ...
28+
def full(self) -> bool: ...
29+
@coroutine
30+
def put(self, item: Any) -> None: ...
31+
def put_nowait(self, item: Any) -> None: ...
32+
@coroutine
33+
def get(self) -> Any: ...
34+
def get_nowait(self) -> Any: ...
35+
36+
37+
class PriorityQueue(Queue): ...
38+
39+
40+
class LifoQueue(Queue): ...
41+
42+
43+
class JoinableQueue(Queue):
44+
def task_done(self) -> None: ...
45+
@coroutine
46+
def join(self) -> None: ...

0 commit comments

Comments
 (0)