diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-06-14 17:46:04 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-06-14 18:00:06 +0300 |
commit | 85f6451860166545196ffa2950aa68be2363733b (patch) | |
tree | 4443b7b2465bda4bdc3589314f258329ecaedb38 /contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py | |
parent | fa297dd4855aef4bd79faebb48120708d2f9249d (diff) | |
download | ydb-85f6451860166545196ffa2950aa68be2363733b.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py index 62530f2b77..854da8012b 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_bindings.py @@ -34,6 +34,7 @@ been assigned, through the `key_binding` decorator.:: # Later, add it to the key bindings. kb.add(Keys.A, my_key_binding) """ + from __future__ import annotations from abc import ABCMeta, abstractmethod, abstractproperty @@ -140,10 +141,8 @@ class Binding: event.app.invalidate() def __repr__(self) -> str: - return "{}(keys={!r}, handler={!r})".format( - self.__class__.__name__, - self.keys, - self.handler, + return ( + f"{self.__class__.__name__}(keys={self.keys!r}, handler={self.handler!r})" ) @@ -226,9 +225,9 @@ class KeyBindings(KeyBindingsBase): def __init__(self) -> None: self._bindings: list[Binding] = [] - self._get_bindings_for_keys_cache: SimpleCache[ - KeysTuple, list[Binding] - ] = SimpleCache(maxsize=10000) + self._get_bindings_for_keys_cache: SimpleCache[KeysTuple, list[Binding]] = ( + SimpleCache(maxsize=10000) + ) self._get_bindings_starting_with_keys_cache: SimpleCache[ KeysTuple, list[Binding] ] = SimpleCache(maxsize=1000) |