Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve readline typings #7141

Merged
merged 3 commits into from
Feb 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions stdlib/readline.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import sys
from _typeshed import StrOrBytesPath
from typing import Callable, Optional, Sequence
from typing import Callable, Sequence

if sys.platform != "win32":
_CompleterT = Optional[Callable[[str, int], Optional[str]]]
_CompDispT = Optional[Callable[[str, Sequence[str], int], None]]
_Completer = Callable[[str, int], str | None]
_CompDisp = Callable[[str, Sequence[str], int], None]

def parse_and_bind(__string: str) -> None: ...
def read_init_file(__filename: StrOrBytesPath | None = ...) -> None: ...
def get_line_buffer() -> str: ...
Expand All @@ -22,13 +23,13 @@ if sys.platform != "win32":
def replace_history_item(__pos: int, __line: str) -> None: ...
def add_history(__string: str) -> None: ...
def set_auto_history(__enabled: bool) -> None: ...
def set_startup_hook(__function: Callable[[], None] | None = ...) -> None: ...
def set_pre_input_hook(__function: Callable[[], None] | None = ...) -> None: ...
def set_completer(__function: _CompleterT = ...) -> None: ...
def get_completer() -> _CompleterT: ...
def set_startup_hook(__function: Callable[[], object] | None = ...) -> None: ...
def set_pre_input_hook(__function: Callable[[], object] | None = ...) -> None: ...
def set_completer(__function: _Completer | None = ...) -> None: ...
def get_completer() -> _Completer | None: ...
def get_completion_type() -> int: ...
def get_begidx() -> int: ...
def get_endidx() -> int: ...
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: _CompDisp | None = ...) -> None: ...