I use Enums inside dictionaries:
Parameters = {
ONE: Enum(
value = 'Options',
names = [
('SEPARATE', 0b1),
('SEQUENTIAL', 0b0)
]
)
}
This style work fits my needs perfectly.
However, when using Enums in a different way, I am able to add docstrings:
class ONE(Enum):
SEPERATE = 0b1
"""The registers associated with each port are separated into different banks"""
SEQUENTIAL = 0b0
"""The registers are in the same bank (addresses are sequential)"""
My question then:
How can I add docstrings when using Enums inside dictionaries as in the first example?
Update Testing enum
Parameters = {
'ONE': Enum(
value = 'ONE',
names = [
('SEPARATE', 0b1),
('SEQUENTIAL', 0b0)
]
)
}
print(Parameters['ONE'].SEPARATE)
Works as expected
Then attempted to extend Enum()
class NewEnum(Enum):
def __init__(self, **kw):
super(NewEnum, self).__init__(**kw)
Parameters = {
'ONE': NewEnum(
value = 'ONE',
names = [
('SEPARATE', 0b1),
('SEQUENTIAL', 0b0)
]
)
}
Does not work.