Enum questions.
Ethan Furman
ethan at stoneleaf.us
Wed Apr 13 17:13:06 EDT 2016
More information about the Python-list mailing list
Wed Apr 13 17:13:06 EDT 2016
- Previous message (by thread): Enum questions.
- Next message (by thread): Enum questions.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/13/2016 07:21 AM, Ethan Furman wrote: > 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> Oh, and to keep it mostly safe, the magic that creates the missing names is turned off as soon as something real happens, like creating a property or a method. -- ~Ethan~
- Previous message (by thread): Enum questions.
- Next message (by thread): Enum questions.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list