From f97685144246d4df6dc7b259cda7a4c9da878eac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 May 2021 11:52:31 +0530 Subject: [PATCH] Make the repr for KeyAction more compact --- kitty/options/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kitty/options/utils.py b/kitty/options/utils.py index 0a87dabfa..3ed75fe53 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -50,6 +50,11 @@ class KeyAction(NamedTuple): func: str args: Sequence[str] = () + def __repr__(self) -> str: + if self.args: + return f'KeyAction({self.func!r}, {self.args!r})' + return f'KeyAction({self.func!r})' + class InvalidMods(ValueError): pass