I noticed a different enumeration behavior in Python.
I was initially surprised to notice that the output for this was int :
>>>import enum >>>class Color(enum.Enum): red = 1 >>>Color.red 1
Then I realized that instead of enum34 , enum installed:
$ sudo apt-get install python-enum34
And now the result is different:
>>>Color.red <Color.red: 1>
My current application accepts enum types, where I get the enum value with value.value . Of course, this will throw an exception if an incorrect enum is set.
How can I deal with this problem?
nowox source share