diff --git a/stdlib/3/asyncio/__init__.pyi b/stdlib/3/asyncio/__init__.pyi index d52787f25..996796ec3 100644 --- a/stdlib/3/asyncio/__init__.pyi +++ b/stdlib/3/asyncio/__init__.pyi @@ -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, ) diff --git a/stdlib/3/asyncio/constants.pyi b/stdlib/3/asyncio/constants.pyi index f15ea4fe2..0b28309e9 100644 --- a/stdlib/3/asyncio/constants.pyi +++ b/stdlib/3/asyncio/constants.pyi @@ -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 = ... diff --git a/stdlib/3/asyncio/futures.pyi b/stdlib/3/asyncio/futures.pyi index 347be12fe..1e492e1b5 100644 --- a/stdlib/3/asyncio/futures.pyi +++ b/stdlib/3/asyncio/futures.pyi @@ -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]: ... diff --git a/stdlib/3/asyncio/streams.pyi b/stdlib/3/asyncio/streams.pyi index e85170089..b691798ab 100644 --- a/stdlib/3/asyncio/streams.pyi +++ b/stdlib/3/asyncio/streams.pyi @@ -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: ... diff --git a/stdlib/3/asyncio/tasks.pyi b/stdlib/3/asyncio/tasks.pyi index 4fb11fb41..a0a5f2253 100644 --- a/stdlib/3/asyncio/tasks.pyi +++ b/stdlib/3/asyncio/tasks.pyi @@ -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]]: ... diff --git a/tests/stubtest_whitelists/py35.txt b/tests/stubtest_whitelists/py35.txt index 4a5b6e575..0d7e78ee9 100644 --- a/tests/stubtest_whitelists/py35.txt +++ b/tests/stubtest_whitelists/py35.txt @@ -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 diff --git a/tests/stubtest_whitelists/py36.txt b/tests/stubtest_whitelists/py36.txt index a80097857..2b2f8f5e9 100644 --- a/tests/stubtest_whitelists/py36.txt +++ b/tests/stubtest_whitelists/py36.txt @@ -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 diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index ecebb7a48..10365662c 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -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