diff --git a/stdlib/readline.pyi b/stdlib/readline.pyi index aff1e504a174..c981463e3df2 100644 --- a/stdlib/readline.pyi +++ b/stdlib/readline.pyi @@ -1,7 +1,7 @@ import sys from _typeshed import StrOrBytesPath from collections.abc import Callable, Sequence -from typing import Literal, TypeAlias +from typing import Literal, SupportsIndex, TypeAlias if sys.platform != "win32": _Completer: TypeAlias = Callable[[str, int], str | None] @@ -19,7 +19,7 @@ if sys.platform != "win32": 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 get_history_item(index: SupportsIndex, /) -> str | None: ... def remove_history_item(pos: int, /) -> None: ... def replace_history_item(pos: int, line: str, /) -> None: ... def add_history(string: str, /) -> None: ...