mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Two minor glitches in stdlib asyncio.Event.wait() / asyncio.wait_for() (#636)
* Event.wait() is a coroutine (https://docs.python.org/3/library/asyncio-sync.html#asyncio.Event) * asyncio.wait_for accepts None as timeout (https://docs.python.org/3/library/asyncio-task.html)
This commit is contained in:
committed by
Guido van Rossum
parent
fed966cf7f
commit
fa1eeb024e
@@ -32,7 +32,7 @@ class Event:
|
||||
def is_set(self) -> bool: ...
|
||||
def set(self) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
|
||||
@coroutine
|
||||
def wait(self) -> bool: ...
|
||||
|
||||
class Condition(_ContextManagerMixin):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, Generator, Iterable, Awaitable, overload, Sequence, Iterator
|
||||
from typing import Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, Generator, Iterable, Awaitable, overload, Sequence, Iterator, Optional
|
||||
|
||||
__all__ = ... # type: str
|
||||
|
||||
@@ -17,7 +17,7 @@ def shield(arg: Union[Future[_T], Generator[Any, None, _T]], *, loop: AbstractEv
|
||||
def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def wait(fs: List[Task[_T]], *, loop: AbstractEventLoop = ...,
|
||||
timeout: float = ..., return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
|
||||
def wait_for(fut: Union[Future[_T], Generator[Any, None, _T]], timeout: float, *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def wait_for(fut: Union[Future[_T], Generator[Any, None, _T]], timeout: Optional[float], *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
|
||||
class _GatheringFuture(Future[_T], Generic[_T]):
|
||||
def __init__(self, children: Sequence[Union[Future[_T], Generator[Any, None, _T]]], *, loop: AbstractEventLoop = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user