mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -2,7 +2,7 @@ import socket
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from typing import Any, Iterable, List, Optional, Tuple, Type, Union
|
||||
from typing import Any, Iterable, List, Tuple, Type, Union
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import SupportsIndex
|
||||
@@ -23,15 +23,15 @@ class _ConnectionBase:
|
||||
def writable(self) -> bool: ... # undocumented
|
||||
def fileno(self) -> int: ...
|
||||
def close(self) -> None: ...
|
||||
def send_bytes(self, buf: bytes, offset: int = ..., size: Optional[int] = ...) -> None: ...
|
||||
def send_bytes(self, buf: bytes, offset: int = ..., size: int | None = ...) -> None: ...
|
||||
def send(self, obj: Any) -> None: ...
|
||||
def recv_bytes(self, maxlength: Optional[int] = ...) -> bytes: ...
|
||||
def recv_bytes(self, maxlength: int | None = ...) -> bytes: ...
|
||||
def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ...
|
||||
def recv(self) -> Any: ...
|
||||
def poll(self, timeout: Optional[float] = ...) -> bool: ...
|
||||
def poll(self, timeout: float | None = ...) -> bool: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]
|
||||
self, exc_type: Type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class Connection(_ConnectionBase): ...
|
||||
@@ -41,23 +41,23 @@ if sys.platform == "win32":
|
||||
|
||||
class Listener:
|
||||
def __init__(
|
||||
self, address: Optional[_Address] = ..., family: Optional[str] = ..., backlog: int = ..., authkey: Optional[bytes] = ...
|
||||
self, address: _Address | None = ..., family: str | None = ..., backlog: int = ..., authkey: bytes | None = ...
|
||||
) -> None: ...
|
||||
def accept(self) -> Connection: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def address(self) -> _Address: ...
|
||||
@property
|
||||
def last_accepted(self) -> Optional[_Address]: ...
|
||||
def last_accepted(self) -> _Address | None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]
|
||||
self, exc_type: Type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
def deliver_challenge(connection: Connection, authkey: bytes) -> None: ...
|
||||
def answer_challenge(connection: Connection, authkey: bytes) -> None: ...
|
||||
def wait(
|
||||
object_list: Iterable[Union[Connection, socket.socket, int]], timeout: Optional[float] = ...
|
||||
) -> List[Union[Connection, socket.socket, int]]: ...
|
||||
def Client(address: _Address, family: Optional[str] = ..., authkey: Optional[bytes] = ...) -> Connection: ...
|
||||
object_list: Iterable[Connection | socket.socket | int], timeout: float | None = ...
|
||||
) -> List[Connection | socket.socket | int]: ...
|
||||
def Client(address: _Address, family: str | None = ..., authkey: bytes | None = ...) -> Connection: ...
|
||||
def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ...
|
||||
|
||||
Reference in New Issue
Block a user