diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 04:45:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 04:45:14 +0000 |
commit | 5b43aaac61ac94abe722bc98ae58468618f2f512 (patch) | |
tree | 3d58c89faa23d194f83abb24ae1fd05067538fff /src/prompt_toolkit/completion | |
parent | Adding upstream version 3.0.43. (diff) | |
download | prompt-toolkit-5b43aaac61ac94abe722bc98ae58468618f2f512.tar.xz prompt-toolkit-5b43aaac61ac94abe722bc98ae58468618f2f512.zip |
Adding upstream version 3.0.46.upstream/3.0.46
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/prompt_toolkit/completion')
-rw-r--r-- | src/prompt_toolkit/completion/base.py | 23 | ||||
-rw-r--r-- | src/prompt_toolkit/completion/nested.py | 1 |
2 files changed, 6 insertions, 18 deletions
diff --git a/src/prompt_toolkit/completion/base.py b/src/prompt_toolkit/completion/base.py index 04a712d..3846ef7 100644 --- a/src/prompt_toolkit/completion/base.py +++ b/src/prompt_toolkit/completion/base.py @@ -1,5 +1,5 @@ -""" -""" +""" """ + from __future__ import annotations from abc import ABCMeta, abstractmethod @@ -66,18 +66,9 @@ class Completion: def __repr__(self) -> str: if isinstance(self.display, str) and self.display == self.text: - return "{}(text={!r}, start_position={!r})".format( - self.__class__.__name__, - self.text, - self.start_position, - ) + return f"{self.__class__.__name__}(text={self.text!r}, start_position={self.start_position!r})" else: - return "{}(text={!r}, start_position={!r}, display={!r})".format( - self.__class__.__name__, - self.text, - self.start_position, - self.display, - ) + return f"{self.__class__.__name__}(text={self.text!r}, start_position={self.start_position!r}, display={self.display!r})" def __eq__(self, other: object) -> bool: if not isinstance(other, Completion): @@ -156,11 +147,7 @@ class CompleteEvent: self.completion_requested = completion_requested def __repr__(self) -> str: - return "{}(text_inserted={!r}, completion_requested={!r})".format( - self.__class__.__name__, - self.text_inserted, - self.completion_requested, - ) + return f"{self.__class__.__name__}(text_inserted={self.text_inserted!r}, completion_requested={self.completion_requested!r})" class Completer(metaclass=ABCMeta): diff --git a/src/prompt_toolkit/completion/nested.py b/src/prompt_toolkit/completion/nested.py index a1d211a..8569bd2 100644 --- a/src/prompt_toolkit/completion/nested.py +++ b/src/prompt_toolkit/completion/nested.py @@ -1,6 +1,7 @@ """ Nestedcompleter for completion of hierarchical data structures. """ + from __future__ import annotations from typing import Any, Iterable, Mapping, Set, Union |