[Python-ideas] PEP for enum library type?

Terry Reedy tjreedy at udel.edu
Wed Feb 13 07:45:54 CET 2013


On 2/12/2013 3:43 PM, Joshua Landau wrote:

> class Color(Enum):
>      values = "RED GREEN BLUE MAGENTA OTHER COLORS HERE TOO".split()
>
> so I'm OK with that, but then you're in the territory when you might as
> well go with the method Barry suggested.

A custom mapping can automatically do the split. This is an interesting 
compromise between no quotes and multiple quotes.

-- 
Terry Jan Reedy




More information about the Python-ideas mailing list