[Python-Dev] Enumeration items: mixed types?

Barry Warsaw barry at python.org
Tue Apr 30 05:45:29 CEST 2013


On Apr 29, 2013, at 04:16 PM, Ethan Furman wrote:

>I suppose the other option is to have `.value` be whatever was assigned (1,
>'really big country', and (8273.199, 517) ), and the fact that
>`int(Stuff.china) ` blows up and doesn't store easily in a database is the
>programmers issue...

Correct.  flufl.enum.IntEnums will blow up earlier, when the class is defined
assigning the attributes to non-int values.

-Barry


More information about the Python-Dev mailing list