[Python-Dev] Enumeration items: mixed types?
Ethan Furman
ethan at stoneleaf.us
Tue Apr 30 00:50:22 CEST 2013
This just doesn't make sense to me:
--> class Stuff(Enum):
... blue = 1
... china = 'really big country'
... random = (8273.199, 517)
--> Stuff.blue.name == 'blue'
--> Stuff.blue.value == 1
--> Stuff.china.name == 'china'
--> Stuff.china.value == ???
--> Stuff.random.name == 'random'
--> Stuff.china.value == ???
In order to make this work at all, we have to support auto-numbering, and I didn't think we were going to do that in the
class syntax?
--
~Ethan~
P.S. Apologies for all the questions, I'm just hoping to get the last details hammered out so we can stop discussing
Enums. ;)
More information about the Python-Dev
mailing list