asyncore: various fixes (#3820)

This commit is contained in:
Shantanu
2020-03-06 02:23:03 -08:00
committed by GitHub
parent af09df9b48
commit e2a409291d
2 changed files with 15 additions and 29 deletions

View File

@@ -23,12 +23,12 @@ class ExitNow(Exception): ...
def read(obj: Any) -> None: ...
def write(obj: Any) -> None: ...
def readwrite(obj: Any, flags: int) -> None: ...
def poll(timeout: float = ..., map: _maptype = ...) -> None: ...
def poll2(timeout: float = ..., map: _maptype = ...) -> None: ...
def poll(timeout: float = ..., map: Optional[_maptype] = ...) -> None: ...
def poll2(timeout: float = ..., map: Optional[_maptype] = ...) -> None: ...
poll3 = poll2
def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = ...) -> None: ...
def loop(timeout: float = ..., use_poll: bool = ..., map: Optional[_maptype] = ..., count: Optional[int] = ...) -> None: ...
# Not really subclass of socket.socket; it's only delegation.
@@ -43,16 +43,16 @@ class dispatcher:
ignore_log_types: frozenset[str]
socket: Optional[SocketType]
def __init__(self, sock: Optional[SocketType] = ..., map: _maptype = ...) -> None: ...
def add_channel(self, map: _maptype = ...) -> None: ...
def del_channel(self, map: _maptype = ...) -> None: ...
def create_socket(self, family: int, type: int) -> None: ...
def set_socket(self, sock: SocketType, map: _maptype = ...) -> None: ...
def __init__(self, sock: Optional[SocketType] = ..., map: Optional[_maptype] = ...) -> None: ...
def add_channel(self, map: Optional[_maptype] = ...) -> None: ...
def del_channel(self, map: Optional[_maptype] = ...) -> None: ...
def create_socket(self, family: int = ..., type: int = ...) -> None: ...
def set_socket(self, sock: SocketType, map: Optional[_maptype] = ...) -> None: ...
def set_reuse_addr(self) -> None: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
def listen(self, backlog: int) -> None: ...
def bind(self, address: Union[Tuple[Any, ...], str]) -> None: ...
def listen(self, num: int) -> None: ...
def bind(self, addr: Union[Tuple[Any, ...], str]) -> None: ...
def connect(self, address: Union[Tuple[Any, ...], str]) -> None: ...
def accept(self) -> Optional[Tuple[SocketType, Any]]: ...
def send(self, data: bytes) -> int: ...
@@ -87,7 +87,7 @@ class dispatcher:
def getsockname(self) -> Any: ...
@overload
def getsockopt(self, level: int, optname: int) -> int: ...
def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
@@ -112,14 +112,14 @@ class dispatcher:
def shutdown(self, how: int) -> None: ...
class dispatcher_with_send(dispatcher):
def __init__(self, sock: SocketType = ..., map: _maptype = ...) -> None: ...
def __init__(self, sock: SocketType = ..., map: Optional[_maptype] = ...) -> None: ...
def initiate_send(self) -> None: ...
def handle_write(self) -> None: ...
# incompatible signature:
# def send(self, data: bytes) -> Optional[int]: ...
def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ...
def close_all(map: _maptype = ..., ignore_all: bool = ...) -> None: ...
def close_all(map: Optional[_maptype] = ..., ignore_all: bool = ...) -> None: ...
# if os.name == 'posix':
# import fcntl
@@ -131,7 +131,7 @@ class file_wrapper:
def send(self, data: bytes, flags: int = ...) -> int: ...
@overload
def getsockopt(self, level: int, optname: int) -> int: ...
def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
@@ -142,5 +142,5 @@ class file_wrapper:
def fileno(self) -> int: ...
class file_dispatcher(dispatcher):
def __init__(self, fd: FileDescriptorLike, map: _maptype = ...) -> None: ...
def __init__(self, fd: FileDescriptorLike, map: Optional[_maptype] = ...) -> None: ...
def set_file(self, fd: int) -> None: ...

View File

@@ -68,20 +68,6 @@ asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
asyncio.windows_events
asyncio.windows_utils
asyncio.wrap_future
asyncore.close_all
asyncore.dispatcher.__init__
asyncore.dispatcher.add_channel
asyncore.dispatcher.bind
asyncore.dispatcher.create_socket
asyncore.dispatcher.del_channel
asyncore.dispatcher.listen
asyncore.dispatcher.set_socket
asyncore.dispatcher_with_send.__init__
asyncore.file_dispatcher.__init__
asyncore.file_wrapper.getsockopt
asyncore.loop
asyncore.poll
asyncore.poll2
base64.b32decode
base64.b64decode
base64.b64encode