mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Return concrete server from abstract event loop (#5566)
https://docs.python.org/3/library/asyncio-eventloop.html?highlight=abstracteventloop#creating-network-servers documents the methods as returning a concrete server object.
This commit is contained in:
@@ -2,15 +2,17 @@ import ssl
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from asyncio.futures import Future
|
||||
from asyncio.protocols import BaseProtocol
|
||||
from asyncio.tasks import Task
|
||||
from asyncio.transports import BaseTransport
|
||||
from asyncio.unix_events import AbstractChildWatcher
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .base_events import Server
|
||||
from .futures import Future
|
||||
from .protocols import BaseProtocol
|
||||
from .tasks import Task
|
||||
from .transports import BaseTransport
|
||||
from .unix_events import AbstractChildWatcher
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
@@ -261,7 +263,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
reuse_port: Optional[bool] = ...,
|
||||
ssl_handshake_timeout: Optional[float] = ...,
|
||||
start_serving: bool = ...,
|
||||
) -> AbstractServer: ...
|
||||
) -> Server: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
@@ -279,7 +281,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
reuse_port: Optional[bool] = ...,
|
||||
ssl_handshake_timeout: Optional[float] = ...,
|
||||
start_serving: bool = ...,
|
||||
) -> AbstractServer: ...
|
||||
) -> Server: ...
|
||||
async def create_unix_connection(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
@@ -300,7 +302,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
ssl: _SSLContext = ...,
|
||||
ssl_handshake_timeout: Optional[float] = ...,
|
||||
start_serving: bool = ...,
|
||||
) -> AbstractServer: ...
|
||||
) -> Server: ...
|
||||
@abstractmethod
|
||||
async def sendfile(
|
||||
self,
|
||||
@@ -338,7 +340,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
ssl: _SSLContext = ...,
|
||||
reuse_address: Optional[bool] = ...,
|
||||
reuse_port: Optional[bool] = ...,
|
||||
) -> AbstractServer: ...
|
||||
) -> Server: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
@@ -354,7 +356,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
ssl: _SSLContext = ...,
|
||||
reuse_address: Optional[bool] = ...,
|
||||
reuse_port: Optional[bool] = ...,
|
||||
) -> AbstractServer: ...
|
||||
) -> Server: ...
|
||||
async def create_unix_connection(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
@@ -372,7 +374,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
sock: Optional[socket] = ...,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
) -> AbstractServer: ...
|
||||
) -> Server: ...
|
||||
@abstractmethod
|
||||
async def create_datagram_endpoint(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user