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

Barry Warsaw barry at python.org
Mon Feb 25 05:14:10 CET 2013
On Feb 24, 2013, at 07:32 PM, Ethan Furman wrote:

>I would still like the int subclass, though, as it would be an aid to me on
>the Python side.

I think you'll know what I'm going to say. :)

1) Usually, you won't need it (see the responses from people who don't care
about the value).

2) When you do, wrapping the item in int() doesn't seem too bad to me.

>>> from flufl.enum import make
>>> Colors = make('Colors', 'red green blue'.split())
>>> int(Colors.blue)
3

Cheers,
-Barry


More information about the Python-Dev mailing list