diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-22 18:38:32 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 18:38:32 (GMT) |
| commit | cd39da75afbede2e5f012065fedd709bf74a9c5f (patch) | |
| tree | 30f1870989460378aa6c9ade443ed6b3ceda936d /Lib/_pyrepl/readline.py | |
| parent | bfd9c3ea5336f2898e3c58e0c3999bfc25d7da89 (diff) | |
| download | cpython-cd39da75afbede2e5f012065fedd709bf74a9c5f.zip cpython-cd39da75afbede2e5f012065fedd709bf74a9c5f.tar.gz cpython-cd39da75afbede2e5f012065fedd709bf74a9c5f.tar.bz2 | |
[3.13] Improve `pyrepl` type-annotation coverage (GH-119081) (#119415)
(cherry picked from commit 033f5c87f1f876088701d1ae078dc39c41177d4a)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Lib/_pyrepl/readline.py')
| -rw-r--r-- | Lib/_pyrepl/readline.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/_pyrepl/readline.py b/Lib/_pyrepl/readline.py index e3444d9..787dbc0 100644 --- a/Lib/_pyrepl/readline.py +++ b/Lib/_pyrepl/readline.py @@ -49,6 +49,9 @@ from collections.abc import Callable, Collection from .types import Callback, Completer, KeySpec, CommandName +MoreLinesCallable = Callable[[str], bool] + + __all__ = [ "add_history", "clear_history", @@ -95,7 +98,7 @@ class ReadlineAlikeReader(historical_reader.HistoricalReader, CompletingReader): # Instance fields config: ReadlineConfig - more_lines: Callable[[str], bool] | None = None + more_lines: MoreLinesCallable | None = None def __post_init__(self) -> None: super().__post_init__() @@ -288,7 +291,7 @@ class _ReadlineWrapper: reader.ps1 = str(prompt) return reader.readline(startup_hook=self.startup_hook) - def multiline_input(self, more_lines, ps1, ps2): + def multiline_input(self, more_lines: MoreLinesCallable, ps1: str, ps2: str) -> tuple[str, bool]: """Read an input on possibly multiple lines, asking for more lines as long as 'more_lines(unicodetext)' returns an object whose boolean value is true. |
