I have roughly the following:
class Foo(IntEnum):
a = 0
b = auto()
c = auto()
strings = ["Alpha", "Beta", "Charlie"]
def __str__(self):
return Foo.strings[self]
However, this raises:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'EnumMeta'
I need to have additional data inside my Foo class, but it appears that Python doesn't like that.
Is there something I'm doing incorrectly, or is there a better way to do this? I'm used to Enum Classes in C++.
strings[Foo Object]while python is expectingstrings[index as int, 0, 1 or 2]