mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
committed by
Guido van Rossum
parent
741dd37422
commit
0192f301b4
@@ -72,7 +72,6 @@ from asyncio.queues import (
|
||||
Queue as Queue,
|
||||
PriorityQueue as PriorityQueue,
|
||||
LifoQueue as LifoQueue,
|
||||
JoinableQueue as JoinableQueue,
|
||||
QueueFull as QueueFull,
|
||||
QueueEmpty as QueueEmpty,
|
||||
)
|
||||
@@ -84,6 +83,9 @@ from asyncio.locks import (
|
||||
BoundedSemaphore as BoundedSemaphore,
|
||||
)
|
||||
|
||||
if sys.version_info < (3, 5):
|
||||
from asyncio.queues import JoinableQueue as JoinableQueue
|
||||
|
||||
# TODO: It should be possible to instantiate these classes, but mypy
|
||||
# currently disallows this.
|
||||
# See https://github.com/python/mypy/issues/1843
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from .coroutines import coroutine
|
||||
from .futures import Future
|
||||
@@ -32,6 +33,10 @@ class Queue(Generic[T]):
|
||||
@coroutine
|
||||
def get(self) -> Future[T]: ...
|
||||
def get_nowait(self) -> T: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
@coroutine
|
||||
def join(self) -> None: ...
|
||||
def task_done(self) -> None: ...
|
||||
|
||||
|
||||
class PriorityQueue(Queue): ...
|
||||
@@ -39,8 +44,8 @@ class PriorityQueue(Queue): ...
|
||||
|
||||
class LifoQueue(Queue): ...
|
||||
|
||||
|
||||
class JoinableQueue(Queue):
|
||||
def task_done(self) -> None: ...
|
||||
@coroutine
|
||||
def join(self) -> None: ...
|
||||
if sys.version_info < (3, 5):
|
||||
class JoinableQueue(Queue):
|
||||
def task_done(self) -> None: ...
|
||||
@coroutine
|
||||
def join(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user