On 04/29/2013 03:50 PM, Ethan Furman wrote:
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?
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...
--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com