[Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as (original) (raw)
Barry Warsaw barry at python.org
Mon Feb 25 05:14:10 CET 2013
- Previous message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Next message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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. :)
Usually, you won't need it (see the responses from people who don't care about the value).
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
- Previous message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Next message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]