From: Luke Kenneth Casson Leighton Date: Mon, 22 May 2023 11:09:31 +0000 (+0100) Subject: make style of consts.py consistent with standard python X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6c66742969d47aa0708d68e0a4e93d829a955aa;p=openpower-isa.git make style of consts.py consistent with standard python practices (and those of this project) - remove underscores in front of imports. the classes named _Const* however are *NOT* so altered because --- diff --git a/src/openpower/consts.py b/src/openpower/consts.py index dd09c8b8..5d6cad85 100644 --- a/src/openpower/consts.py +++ b/src/openpower/consts.py @@ -1,4 +1,4 @@ -import enum as _enum +import enum # Can't think of a better place to put these functions. @@ -76,18 +76,18 @@ def field(r, msb0_start, msb0_end=None, field_width=64): # this module, aside from creating various field constants, # helps out by creating alternative (identical) classes with # a "b" name to indicate "MSB0 big-endian". -class _Const(_enum.IntEnum): +class _Const(enum.IntEnum): pass -class _ConstLEMeta(_enum.EnumMeta): +class _ConstLEMeta(enum.EnumMeta): def __call__(metacls, *args, **kwargs): if len(args) > 1: names = args[1] else: names = kwargs.pop("names") - if isinstance(names, type) and issubclass(names, _enum.Enum): + if isinstance(names, type) and issubclass(names, enum.Enum): names = dict(names.__members__) if isinstance(names, dict): names = tuple(names.items())