From 5fb98919ff163eb098d6e486ec0da43edf8df65c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 22 May 2023 12:09:31 +0100 Subject: [PATCH] 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 --- src/openpower/consts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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()) -- 2.30.2