Re: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as

2013年2月23日 10:19:56 -0800

On 02/23/2013 09:46 AM, Nick Coghlan wrote:
Many other existing libraries would be in the same boat - backwards
compatibility would be an insurmountable barrier to using enums, but
they *could* use named values.
I like the idea of named values, but to be clear about enums: if they are 
int-based (like
True and False are) and don't mess with the math operations (like True and 
False don't) then
we could use them with impunity:
 True + False = 1
 os.SEEK_CUR * 3 = 3 (assuming, of course, that os.SEEK_CUR == 1)
--
~Ethan~
P.S. Has the irrevokable decision been made that enums will *not* be int 
based? If so, I'll
stop bringing up this point -- I'm starting to bore myself with it.
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to