From acef37018c4af5b5d9820a69fca76cfd53fdeaa5 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 2 May 2021 17:01:19 -0700 Subject: [PATCH] readline: fix stubtest errors (#5326) --- stdlib/readline.pyi | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/stdlib/readline.pyi b/stdlib/readline.pyi index 9b8e05f09..8f28a2b2b 100644 --- a/stdlib/readline.pyi +++ b/stdlib/readline.pyi @@ -1,39 +1,40 @@ import sys +from _typeshed import AnyPath from typing import Callable, Optional, Sequence _CompleterT = Optional[Callable[[str, int], Optional[str]]] _CompDispT = Optional[Callable[[str, Sequence[str], int], None]] -def parse_and_bind(string: str) -> None: ... -def read_init_file(filename: str = ...) -> None: ... +def parse_and_bind(__string: str) -> None: ... +def read_init_file(__filename: Optional[AnyPath] = ...) -> None: ... def get_line_buffer() -> str: ... -def insert_text(string: str) -> None: ... +def insert_text(__string: str) -> None: ... def redisplay() -> None: ... -def read_history_file(filename: str = ...) -> None: ... -def write_history_file(filename: str = ...) -> None: ... +def read_history_file(__filename: Optional[AnyPath] = ...) -> None: ... +def write_history_file(__filename: Optional[AnyPath] = ...) -> None: ... if sys.version_info >= (3, 5): - def append_history_file(nelements: int, filename: str = ...) -> None: ... + def append_history_file(__nelements: int, __filename: Optional[AnyPath] = ...) -> None: ... def get_history_length() -> int: ... -def set_history_length(length: int) -> None: ... +def set_history_length(__length: int) -> None: ... def clear_history() -> None: ... def get_current_history_length() -> int: ... -def get_history_item(index: int) -> str: ... -def remove_history_item(pos: int) -> None: ... -def replace_history_item(pos: int, line: str) -> None: ... -def add_history(string: str) -> None: ... +def get_history_item(__index: int) -> str: ... +def remove_history_item(__pos: int) -> None: ... +def replace_history_item(__pos: int, __line: str) -> None: ... +def add_history(__string: str) -> None: ... if sys.version_info >= (3, 6): - def set_auto_history(enabled: bool) -> None: ... + def set_auto_history(__enabled: bool) -> None: ... -def set_startup_hook(function: Optional[Callable[[], None]] = ...) -> None: ... -def set_pre_input_hook(function: Optional[Callable[[], None]] = ...) -> None: ... -def set_completer(function: _CompleterT = ...) -> None: ... +def set_startup_hook(__function: Optional[Callable[[], None]] = ...) -> None: ... +def set_pre_input_hook(__function: Optional[Callable[[], None]] = ...) -> None: ... +def set_completer(__function: _CompleterT = ...) -> None: ... def get_completer() -> _CompleterT: ... def get_completion_type() -> int: ... def get_begidx() -> int: ... def get_endidx() -> int: ... -def set_completer_delims(string: str) -> None: ... +def set_completer_delims(__string: str) -> None: ... def get_completer_delims() -> str: ... -def set_completion_display_matches_hook(function: _CompDispT = ...) -> None: ... +def set_completion_display_matches_hook(__function: _CompDispT = ...) -> None: ...