summaryrefslogtreecommitdiffstats
path: root/src/prompt_toolkit/completion
diff options
context:
space:
mode:
Diffstat (limited to 'src/prompt_toolkit/completion')
-rw-r--r--src/prompt_toolkit/completion/base.py23
-rw-r--r--src/prompt_toolkit/completion/nested.py1
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