mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-24 20:12:08 +08:00
asyncio: various fixes (#3947)
* asyncio: remove BaseChildWatcher from top level * asyncio.sleep: loop is keyword-only * asyncio: remove Server from top level * asyncio: add FastChildWatcher to top level * asyncio.constants: fix version availability * asyncio: fix arg name for _wakeup * asyncio: fix arg name for wrap_future * asyncio.streams: add Optional to various arguments It might be possible to further improve some of these with overloads. * stubtest: fix whitelist Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -49,10 +49,7 @@ from asyncio.tasks import (
|
||||
wait_for as wait_for,
|
||||
Task as Task,
|
||||
)
|
||||
from asyncio.base_events import (
|
||||
BaseEventLoop as BaseEventLoop,
|
||||
Server as Server
|
||||
)
|
||||
from asyncio.base_events import BaseEventLoop as BaseEventLoop
|
||||
from asyncio.events import (
|
||||
AbstractEventLoopPolicy as AbstractEventLoopPolicy,
|
||||
AbstractEventLoop as AbstractEventLoop,
|
||||
@@ -112,7 +109,7 @@ if sys.version_info >= (3, 7):
|
||||
if sys.platform != 'win32':
|
||||
from .unix_events import (
|
||||
AbstractChildWatcher as AbstractChildWatcher,
|
||||
BaseChildWatcher as BaseChildWatcher,
|
||||
FastChildWatcher as FastChildWatcher,
|
||||
SafeChildWatcher as SafeChildWatcher,
|
||||
SelectorEventLoop as SelectorEventLoop,
|
||||
)
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
|
||||
import enum
|
||||
import sys
|
||||
|
||||
LOG_THRESHOLD_FOR_CONNLOST_WRITES: int
|
||||
ACCEPT_RETRY_DELAY: int
|
||||
DEBUG_STACK_DEPTH: int
|
||||
SSL_HANDSHAKE_TIMEOUT: float
|
||||
SENDFILE_FALLBACK_READBUFFER_SIZE: int
|
||||
if sys.version_info >= (3, 6):
|
||||
DEBUG_STACK_DEPTH: int
|
||||
if sys.version_info >= (3, 7):
|
||||
SSL_HANDSHAKE_TIMEOUT: float
|
||||
SENDFILE_FALLBACK_READBUFFER_SIZE: int
|
||||
|
||||
class _SendfileMode(enum.Enum):
|
||||
UNSUPPORTED: int = ...
|
||||
|
||||
@@ -59,4 +59,4 @@ class Future(Awaitable[_T], Iterable[_T]):
|
||||
@property
|
||||
def _loop(self) -> AbstractEventLoop: ...
|
||||
|
||||
def wrap_future(f: Union[_ConcurrentFuture[_T], Future[_T]], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
|
||||
def wrap_future(future: Union[_ConcurrentFuture[_T], Future[_T]], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
|
||||
|
||||
@@ -18,8 +18,8 @@ if sys.version_info < (3, 8):
|
||||
def __init__(self, message: str, consumed: int) -> None: ...
|
||||
|
||||
async def open_connection(
|
||||
host: str = ...,
|
||||
port: Union[int, str] = ...,
|
||||
host: Optional[str] = ...,
|
||||
port: Optional[Union[int, str]] = ...,
|
||||
*,
|
||||
loop: Optional[events.AbstractEventLoop] = ...,
|
||||
limit: int = ...,
|
||||
@@ -46,7 +46,7 @@ if sys.platform != 'win32':
|
||||
_PathType = str
|
||||
|
||||
async def open_unix_connection(
|
||||
path: _PathType = ...,
|
||||
path: Optional[_PathType] = ...,
|
||||
*,
|
||||
loop: Optional[events.AbstractEventLoop] = ...,
|
||||
limit: int = ...,
|
||||
@@ -55,7 +55,7 @@ if sys.platform != 'win32':
|
||||
|
||||
async def start_unix_server(
|
||||
client_connected_cb: _ClientConnectedCallback,
|
||||
path: _PathType = ...,
|
||||
path: Optional[_PathType] = ...,
|
||||
*,
|
||||
loop: Optional[events.AbstractEventLoop] = ...,
|
||||
limit: int = ...,
|
||||
@@ -66,7 +66,7 @@ class FlowControlMixin(protocols.Protocol): ...
|
||||
class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
|
||||
def __init__(self,
|
||||
stream_reader: StreamReader,
|
||||
client_connected_cb: _ClientConnectedCallback = ...,
|
||||
client_connected_cb: Optional[_ClientConnectedCallback] = ...,
|
||||
loop: Optional[events.AbstractEventLoop] = ...) -> None: ...
|
||||
def connection_made(self, transport: transports.BaseTransport) -> None: ...
|
||||
def connection_lost(self, exc: Optional[Exception]) -> None: ...
|
||||
|
||||
@@ -85,7 +85,7 @@ def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_
|
||||
def run_coroutine_threadsafe(coro: _FutureT[_T],
|
||||
loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
|
||||
def shield(arg: _FutureT[_T], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ..., loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ..., *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ...
|
||||
def wait(fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., timeout: Optional[float] = ...,
|
||||
return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
|
||||
def wait_for(fut: _FutureT[_T], timeout: Optional[float],
|
||||
@@ -115,7 +115,7 @@ class Task(Future[_T], Generic[_T]):
|
||||
def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ...
|
||||
def cancel(self) -> bool: ...
|
||||
if sys.version_info < (3, 7):
|
||||
def _wakeup(self, future: Future[Any]) -> None: ...
|
||||
def _wakeup(self, fut: Future[Any]) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def all_tasks(loop: Optional[AbstractEventLoop] = ...) -> Set[Task[Any]]: ...
|
||||
|
||||
@@ -3,9 +3,7 @@ asyncio.Future._exception
|
||||
asyncio.Future._loop
|
||||
asyncio.Future._tb_logger
|
||||
asyncio.Task.__init__
|
||||
asyncio.constants.DEBUG_STACK_DEPTH
|
||||
asyncio.constants.SENDFILE_FALLBACK_READBUFFER_SIZE
|
||||
asyncio.constants.SSL_HANDSHAKE_TIMEOUT
|
||||
asyncio.Task._wakeup
|
||||
asyncio.exceptions
|
||||
asyncio.futures.Future._callbacks
|
||||
asyncio.futures.Future._exception
|
||||
@@ -15,6 +13,7 @@ asyncio.futures._TracebackLogger.__init__
|
||||
asyncio.protocols.BufferedProtocol
|
||||
asyncio.runners
|
||||
asyncio.tasks.Task.__init__
|
||||
asyncio.tasks.Task._wakeup
|
||||
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
|
||||
bdb.GENERATOR_AND_COROUTINE_FLAGS
|
||||
builtins.str.maketrans
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
asyncio.Future.__init__
|
||||
asyncio.Task._wakeup
|
||||
asyncio.constants.SENDFILE_FALLBACK_READBUFFER_SIZE
|
||||
asyncio.constants.SSL_HANDSHAKE_TIMEOUT
|
||||
asyncio.exceptions
|
||||
asyncio.futures.Future.__init__
|
||||
asyncio.futures._TracebackLogger.__init__
|
||||
asyncio.protocols.BufferedProtocol
|
||||
asyncio.runners
|
||||
asyncio.tasks.Task._wakeup
|
||||
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
|
||||
builtins.str.maketrans
|
||||
cmath.log
|
||||
|
||||
@@ -14,39 +14,25 @@ abc.abstractstaticmethod
|
||||
aifc.open
|
||||
aifc.openfp
|
||||
argparse.Namespace.__getattr__
|
||||
asyncio.BaseChildWatcher
|
||||
asyncio.BaseEventLoop.subprocess_exec
|
||||
asyncio.Condition.acquire
|
||||
asyncio.Condition.locked
|
||||
asyncio.Condition.release
|
||||
asyncio.Server
|
||||
asyncio.StreamReaderProtocol.__init__
|
||||
asyncio.Task.get_stack
|
||||
asyncio.Task.print_stack
|
||||
asyncio.WriteTransport.set_write_buffer_limits
|
||||
asyncio.base_events.BaseEventLoop.subprocess_exec
|
||||
asyncio.futures.wrap_future
|
||||
asyncio.locks.Condition.acquire
|
||||
asyncio.locks.Condition.locked
|
||||
asyncio.locks.Condition.release
|
||||
asyncio.open_connection
|
||||
asyncio.open_unix_connection
|
||||
asyncio.proactor_events.BaseProactorEventLoop.sock_recv
|
||||
asyncio.selector_events.BaseSelectorEventLoop.sock_recv
|
||||
asyncio.sleep
|
||||
asyncio.start_unix_server
|
||||
asyncio.streams.StreamReaderProtocol.__init__
|
||||
asyncio.streams.open_connection
|
||||
asyncio.streams.open_unix_connection
|
||||
asyncio.streams.start_unix_server
|
||||
asyncio.tasks.Task.get_stack
|
||||
asyncio.tasks.Task.print_stack
|
||||
asyncio.tasks.sleep
|
||||
asyncio.transports.WriteTransport.set_write_buffer_limits
|
||||
asyncio.transports._FlowControlMixin.set_write_buffer_limits
|
||||
asyncio.windows_events
|
||||
asyncio.windows_utils
|
||||
asyncio.wrap_future
|
||||
base64.b32decode
|
||||
base64.b64decode
|
||||
base64.b64encode
|
||||
|
||||
Reference in New Issue
Block a user