[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
Sat Feb 23 17:34:54 CET 2013


On Feb 23, 2013, at 04:02 PM, Stefan Krah wrote:

>Hmm. I think this limits interoperation with C libraries and prototyping
>C code.

As for flufl.enums, it doesn't really, because while items are not ints they
are interoperable with ints.

>>> from flufl.enum import make
>>> Colors = make('Colors', 'red green blue'.split())
>>> int(Colors.green)
2
>>> 7 + int(Colors.green)
9

Cheers,
-Barry


More information about the Python-Dev mailing list