mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Rework socket (#5545)
* Extract _socket.pyi from socket.pyi. * Extract _socket.socket from socket.socket. * Fix socket.family annotation. * Annotate SocketIO properly. * SocketType is an alias of _socket.socket. * Sort items in socket.pyi in the same order as in socket.py. * Remove socket.EINTR. * Use _typeshed.WriteableBuffer instead of custom alias. * Add errorTab (Windows only). * Add _socket.dup(). * Mark positional-only argments. * Remove constructors from socket exceptions. * socket.timeout is an alias for TimeoutError, starting with Python 3.10. * Use PEP 604 in changed lines. * Add alias for fileno arguments. * getaddrinfo() port can be bytes. * Explicitly override some SSLSocket methods. * Allow ReadableBuffer in _CMSG arguments.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from socket import SocketType
|
||||
from socket import socket
|
||||
from typing import Any, AnyStr, Mapping, Optional, Tuple, Type
|
||||
|
||||
from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name
|
||||
@@ -128,7 +128,7 @@ class Connection:
|
||||
def kill(self, thread_id): ...
|
||||
def ping(self, reconnect: bool = ...) -> None: ...
|
||||
def set_charset(self, charset) -> None: ...
|
||||
def connect(self, sock: Optional[SocketType] = ...) -> None: ...
|
||||
def connect(self, sock: Optional[socket] = ...) -> None: ...
|
||||
def write_packet(self, payload) -> None: ...
|
||||
def _read_packet(self, packet_type=...): ...
|
||||
def insert_id(self): ...
|
||||
|
||||
Reference in New Issue
Block a user