From: Dmitry Selyutin Date: Tue, 30 Aug 2022 08:47:44 +0000 (+0300) Subject: power_insn: fix Fields methods X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ecf60ca5eb94f0d1d09d6dbbe0d9a89adc1a0c0;p=openpower-isa.git power_insn: fix Fields methods --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 1f93c76b..5949db38 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -396,14 +396,14 @@ class Fields: def __repr__(self): return repr(self.__mapping) + def __iter__(self): + yield from self.__mapping.items() + def __contains__(self, key): return self.__mapping.__contains__(key) def __getitem__(self, key): - return self.__mapping.__getitem__(key) - - def get(self, key, default): - return self.__mapping.get(key, default) + return self.__mapping.get(key, None) @_functools.total_ordering