I want to write class for Enums in Python.
My issue is that I want to have same value for different enum inputs. For example:
class Animal(Enum):
Cat = ['Perian cat', 'Bengal cat', 'Siamese cat']
So then I could use it like this:
some_animal = Animal('Persian cat')
print(some_animal)
>> Animal.Cat
I think it is not possible, but just to be sure I wanted to ask for that here.
UPDATE
I tried this solution:
class _Cat(Enum):
BENGAL = 'Bengal cat'
PERSIAN = 'Persian cat'
SIAMESE = 'Siamese cat'
class Animal(Enum):
Cat = _Cat
It works in that sense that I can access the values of the Cat class, but what I would like to achieve is something like this:
some_animal = Animal('Persian cat')
print(some_animal)
>> Animal.Cat.PERSIAN
Thanks.