Enum questions.

Ethan Furman ethan at stoneleaf.us
Wed Apr 13 10:21:40 EDT 2016


On 04/13/2016 07:07 AM, Marko Rauhamaa wrote:

>      class Color(enum.Enum):
>          red
>          blue
>          green
>
>
> This last one is to the point but raises a NameError.

Using the aenum library that last one is possible.  It also has 
NamedConstant and a metaclass-derived NamedTuple! </shameless plug>

--
~Ethan~




More information about the Python-list mailing list