From f17abc9202dd19fe4f17f573179818cd2a02f099 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 19 Apr 2022 12:47:24 +0000 Subject: [PATCH] selectable_int: make SelectableInt.__repr__ more flexible --- src/openpower/decoder/selectable_int.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openpower/decoder/selectable_int.py b/src/openpower/decoder/selectable_int.py index c5e48f9f..9e1495d5 100644 --- a/src/openpower/decoder/selectable_int.py +++ b/src/openpower/decoder/selectable_int.py @@ -420,8 +420,8 @@ class SelectableInt: return self.value != 0 def __repr__(self): - return "SelectableInt(value=0x{:x}, bits={})".format(self.value, - self.bits) + value = f"value=0x{self.value:x}, bits={self.bits}" + return f"{self.__class__.__name__}({value})" def __len__(self): return self.bits -- 2.30.2