mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import socket
|
||||
from _typeshed import Self
|
||||
from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union
|
||||
from typing import Any, Callable, Match, Pattern, Sequence, Tuple
|
||||
|
||||
DEBUGLEVEL: int
|
||||
TELNET_PORT: int
|
||||
@@ -82,8 +82,8 @@ EXOPL: bytes
|
||||
NOOPT: bytes
|
||||
|
||||
class Telnet:
|
||||
host: Optional[str] # undocumented
|
||||
def __init__(self, host: Optional[str] = ..., port: int = ..., timeout: float = ...) -> None: ...
|
||||
host: str | None # undocumented
|
||||
def __init__(self, host: str | None = ..., port: int = ..., timeout: float = ...) -> None: ...
|
||||
def open(self, host: str, port: int = ..., timeout: float = ...) -> None: ...
|
||||
def msg(self, msg: str, *args: Any) -> None: ...
|
||||
def set_debuglevel(self, debuglevel: int) -> None: ...
|
||||
@@ -91,7 +91,7 @@ class Telnet:
|
||||
def get_socket(self) -> socket.socket: ...
|
||||
def fileno(self) -> int: ...
|
||||
def write(self, buffer: bytes) -> None: ...
|
||||
def read_until(self, match: bytes, timeout: Optional[float] = ...) -> bytes: ...
|
||||
def read_until(self, match: bytes, timeout: float | None = ...) -> bytes: ...
|
||||
def read_all(self) -> bytes: ...
|
||||
def read_some(self) -> bytes: ...
|
||||
def read_very_eager(self) -> bytes: ...
|
||||
@@ -99,7 +99,7 @@ class Telnet:
|
||||
def read_lazy(self) -> bytes: ...
|
||||
def read_very_lazy(self) -> bytes: ...
|
||||
def read_sb_data(self) -> bytes: ...
|
||||
def set_option_negotiation_callback(self, callback: Optional[Callable[[socket.socket, bytes, bytes], Any]]) -> None: ...
|
||||
def set_option_negotiation_callback(self, callback: Callable[[socket.socket, bytes, bytes], Any] | None) -> None: ...
|
||||
def process_rawq(self) -> None: ...
|
||||
def rawq_getchar(self) -> bytes: ...
|
||||
def fill_rawq(self) -> None: ...
|
||||
@@ -108,7 +108,7 @@ class Telnet:
|
||||
def mt_interact(self) -> None: ...
|
||||
def listener(self) -> None: ...
|
||||
def expect(
|
||||
self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[float] = ...
|
||||
) -> Tuple[int, Optional[Match[bytes]], bytes]: ...
|
||||
self, list: Sequence[Pattern[bytes] | bytes], timeout: float | None = ...
|
||||
) -> Tuple[int, Match[bytes] | None, bytes]: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user