Skip to content

Commit 8856452

Browse files
authored
Model missing readline history entries as optional strings (#16524)
1 parent efe1c4b commit 8856452

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎stdlib/readline.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from _typeshed import StrOrBytesPath
33
from collections.abc import Callable, Sequence
4-
from typing import Literal, TypeAlias
4+
from typing import Literal, SupportsIndex, TypeAlias
55

66
if sys.platform != "win32":
77
_Completer: TypeAlias = Callable[[str, int], str | None]
@@ -19,7 +19,7 @@ if sys.platform != "win32":
1919
def set_history_length(length: int, /) -> None: ...
2020
def clear_history() -> None: ...
2121
def get_current_history_length() -> int: ...
22-
def get_history_item(index: int, /) -> str: ...
22+
def get_history_item(index: SupportsIndex, /) -> str | None: ...
2323
def remove_history_item(pos: int, /) -> None: ...
2424
def replace_history_item(pos: int, line: str, /) -> None: ...
2525
def add_history(string: str, /) -> None: ...

0 commit comments

Comments
 (0)