Add default values for third-party stubs beginning with 'P' (#9957)

This commit is contained in:
Alex Waygood
2023-03-27 18:58:53 +01:00
committed by GitHub
parent 20f9b3685d
commit 6fd7e36e80
248 changed files with 2181 additions and 2133 deletions
+7 -7
View File
@@ -125,7 +125,7 @@ class TelnetOption:
ack_yes: bytes,
ack_no: bytes,
initial_state: str,
activation_callback: Callable[[], Any] | None = ...,
activation_callback: Callable[[], Any] | None = None,
) -> None: ...
def process_incoming(self, command: bytes) -> None: ...
@@ -136,12 +136,12 @@ class TelnetSubnegotiation:
value: bytes | None
ack_option: bytes
state: str
def __init__(self, connection: Serial, name: str, option: bytes, ack_option: bytes | None = ...) -> None: ...
def __init__(self, connection: Serial, name: str, option: bytes, ack_option: bytes | None = None) -> None: ...
def set(self, value: bytes) -> None: ...
def is_ready(self) -> bool: ...
@property
def active(self) -> bool: ...
def wait(self, timeout: float = ...) -> None: ...
def wait(self, timeout: float = 3) -> None: ...
def check_answer(self, suboption: bytes) -> None: ...
class Serial(SerialBase):
@@ -163,7 +163,7 @@ class Serial(SerialBase):
@property
def cd(self) -> bool: ...
def telnet_send_option(self, action: bytes, option: bytes) -> None: ...
def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = ...) -> None: ...
def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = b"") -> None: ...
def rfc2217_send_purge(self, value: bytes) -> None: ...
def rfc2217_set_control(self, value: bytes) -> None: ...
def rfc2217_flow_server_ready(self) -> None: ...
@@ -179,9 +179,9 @@ class PortManager:
modemstate_mask: int
last_modemstate: int | None
linstate_mask: int
def __init__(self, serial_port: Serial, connection: Serial, logger: logging.Logger | None = ...) -> None: ...
def __init__(self, serial_port: Serial, connection: Serial, logger: logging.Logger | None = None) -> None: ...
def telnet_send_option(self, action: bytes, option: bytes) -> None: ...
def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = ...) -> None: ...
def check_modem_lines(self, force_notification: bool = ...) -> None: ...
def rfc2217_send_subnegotiation(self, option: bytes, value: bytes = b"") -> None: ...
def check_modem_lines(self, force_notification: bool = False) -> None: ...
def escape(self, data: bytes) -> Generator[bytes, None, None]: ...
def filter(self, data: bytes) -> Generator[bytes, None, None]: ...
+5 -5
View File
@@ -8,11 +8,11 @@ class RS485Settings:
delay_before_rx: float | None
def __init__(
self,
rts_level_for_tx: bool = ...,
rts_level_for_rx: bool = ...,
loopback: bool = ...,
delay_before_tx: float | None = ...,
delay_before_rx: float | None = ...,
rts_level_for_tx: bool = True,
rts_level_for_rx: bool = False,
loopback: bool = False,
delay_before_tx: float | None = None,
delay_before_rx: float | None = None,
) -> None: ...
class RS485(serial.Serial): ...
+14 -14
View File
@@ -52,18 +52,18 @@ class SerialBase(io.RawIOBase):
name: str | None
def __init__(
self,
port: str | None = ...,
baudrate: int = ...,
bytesize: int = ...,
parity: str = ...,
stopbits: float = ...,
timeout: float | None = ...,
xonxoff: bool = ...,
rtscts: bool = ...,
write_timeout: float | None = ...,
dsrdtr: bool = ...,
inter_byte_timeout: float | None = ...,
exclusive: float | None = ...,
port: str | None = None,
baudrate: int = 9600,
bytesize: int = 8,
parity: str = "N",
stopbits: float = 1,
timeout: float | None = None,
xonxoff: bool = False,
rtscts: bool = False,
write_timeout: float | None = None,
dsrdtr: bool = False,
inter_byte_timeout: float | None = None,
exclusive: float | None = None,
) -> None: ...
# Return type:
@@ -147,7 +147,7 @@ class SerialBase(io.RawIOBase):
def get_settings(self) -> dict[str, Any]: ...
def apply_settings(self, d: dict[str, Any]) -> None: ...
def readinto(self, __buffer: WriteableBuffer) -> int: ... # returns int unlike `io.RawIOBase`
def send_break(self, duration: float = ...) -> None: ...
def send_break(self, duration: float = 0.25) -> None: ...
def read_all(self) -> bytes | None: ...
def read_until(self, expected: bytes = ..., size: int | None = ...) -> bytes: ...
def read_until(self, expected: bytes = b"\n", size: int | None = None) -> bytes: ...
def iread_until(self, expected: bytes = ..., size: int | None = ...) -> Generator[bytes, None, None]: ...
+2 -2
View File
@@ -18,8 +18,8 @@ class Serial(SerialBase):
def ri(self) -> bool: ...
@property
def cd(self) -> bool: ...
def set_buffer_size(self, rx_size: int = ..., tx_size: int | None = ...) -> None: ...
def set_output_flow_control(self, enable: bool = ...) -> None: ...
def set_buffer_size(self, rx_size: int = 4096, tx_size: int | None = None) -> None: ...
def set_output_flow_control(self, enable: bool = True) -> None: ...
@property
def out_waiting(self) -> int: ...
def cancel_read(self) -> None: ...
@@ -3,19 +3,19 @@ from _typeshed import ReadableBuffer
HEXDIGITS: str
def hex_encode(data: str, errors: str = ...) -> tuple[bytes, int]: ...
def hex_decode(data: bytes, errors: str = ...) -> tuple[str, int]: ...
def hex_encode(data: str, errors: str = "strict") -> tuple[bytes, int]: ...
def hex_decode(data: bytes, errors: str = "strict") -> tuple[str, int]: ...
class Codec(codecs.Codec):
def encode(self, data: str, errors: str = ...) -> tuple[bytes, int]: ...
def decode(self, data: bytes, errors: str = ...) -> tuple[str, int]: ...
def encode(self, data: str, errors: str = "strict") -> tuple[bytes, int]: ...
def decode(self, data: bytes, errors: str = "strict") -> tuple[str, int]: ...
class IncrementalEncoder(codecs.IncrementalEncoder):
state: int
def encode(self, data: str, final: bool = ...) -> bytes: ...
def encode(self, data: str, final: bool = False) -> bytes: ...
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, data: ReadableBuffer, final: bool = ...) -> str: ...
def decode(self, data: ReadableBuffer, final: bool = False) -> str: ...
class StreamWriter(Codec, codecs.StreamWriter): ...
class StreamReader(Codec, codecs.StreamReader): ...
+1 -1
View File
@@ -7,5 +7,5 @@ if sys.platform == "win32":
else:
from serial.tools.list_ports_posix import comports as comports
def grep(regexp: str | re.Pattern[str], include_links: bool = ...) -> Generator[tuple[str, str, str], None, None]: ...
def grep(regexp: str | re.Pattern[str], include_links: bool = False) -> Generator[tuple[str, str, str], None, None]: ...
def main() -> None: ...
@@ -23,7 +23,7 @@ class ListPortInfo:
manufacturer: str | None
product: str | None
interface: str | None
def __init__(self, device: str, skip_link_detection: bool = ...) -> None: ...
def __init__(self, device: str, skip_link_detection: bool = False) -> None: ...
def usb_description(self) -> str: ...
def usb_info(self) -> str: ...
def apply_usb_info(self) -> None: ...
@@ -8,4 +8,4 @@ class SysFS(ListPortInfo):
def __init__(self, device: str) -> None: ...
def read_line(self, *args: str) -> str | None: ...
def comports(include_links: bool = ...) -> list[SysFS]: ...
def comports(include_links: bool = False) -> list[SysFS]: ...
@@ -69,8 +69,8 @@ if sys.platform == "win32":
child_devinst: ctypes._CData,
child_vid: int | None,
child_pid: int | None,
depth: int = ...,
last_serial_number: str | None = ...,
depth: int = 0,
last_serial_number: str | None = None,
) -> str: ...
def iterate_comports() -> Generator[ListPortInfo, None, None]: ...
def comports(include_links: bool = ...) -> list[ListPortInfo]: ...
def comports(include_links: bool = False) -> list[ListPortInfo]: ...
+5 -5
View File
@@ -84,17 +84,17 @@ class Miniterm:
rx_decoder: codecs.IncrementalDecoder | None
tx_decoder: codecs.IncrementalDecoder | None
tx_encoder: codecs.IncrementalEncoder | None
def __init__(self, serial_instance: Serial, echo: bool = ..., eol: str = ..., filters: Iterable[str] = ...) -> None: ...
def __init__(self, serial_instance: Serial, echo: bool = False, eol: str = "crlf", filters: Iterable[str] = ()) -> None: ...
transmitter_thread: threading.Thread
def start(self) -> None: ...
def stop(self) -> None: ...
def join(self, transmit_only: bool = ...) -> None: ...
def join(self, transmit_only: bool = False) -> None: ...
def close(self) -> None: ...
tx_transformations: list[Transform]
rx_transformations: list[Transform]
def update_transformations(self) -> None: ...
def set_rx_encoding(self, encoding: str, errors: str = ...) -> None: ...
def set_tx_encoding(self, encoding: str, errors: str = ...) -> None: ...
def set_rx_encoding(self, encoding: str, errors: str = "replace") -> None: ...
def set_tx_encoding(self, encoding: str, errors: str = "replace") -> None: ...
def dump_port_settings(self) -> None: ...
def reader(self) -> None: ...
def writer(self) -> None: ...
@@ -108,5 +108,5 @@ class Miniterm:
def get_help_text(self) -> str: ...
def main(
default_port: str | None = ..., default_baudrate: int = ..., default_rts: int | None = ..., default_dtr: int | None = ...
default_port: str | None = None, default_baudrate: int = 9600, default_rts: int | None = None, default_dtr: int | None = None
) -> None: ...
@@ -26,7 +26,7 @@ class FormatHexdump(_Formatter):
tx_color: str
control_color: str
def __init__(self, output: TextIO, color: bool) -> None: ...
def write_line(self, timestamp: float, label: str, value: str, value2: str = ...) -> None: ...
def write_line(self, timestamp: float, label: str, value: str, value2: str = "") -> None: ...
class Serial(serial.Serial):
formatter: FormatRaw | FormatHexdump | None