[Python-ideas] adopt an enum type for the standard library?
lists at cheimes.de
Wed Jan 23 14:16:48 CET 2008
Mark Summerfield wrote:
> There is an enum module in PyPI
> and there are several versions in the Python Cookbook.
> Wouldn't one of these be worth adopting for the standard library?
It might be worth adding an enum to Python 2.6. I'm +0 on it.
The enum implementation from pypi is not sufficient for Python core. I
don't like its __cmp__ and __hash__ code. I also miss the feature to set
a start value or to skip values:
>>> enum = Enum("error=-1", "ok", "also_ok", "someother=1000", "last")
More information about the Python-ideas