[Python-ideas] PEP for enum library type?

Barry Warsaw barry at python.org
Wed Feb 13 19:19:14 CET 2013


On Feb 13, 2013, at 08:19 AM, Tim Delaney wrote:

>I'm of the opinion that the most fundamental property of an enum is that it
>can generate its values automatically. Everything else is a nice-to-have,
>but without that property it's not much use as an enum.

See, I don't care about that much because I define an enum once, but I *use*
it hundreds of times.  Thus a little more verbosity/explicitness at definition
time is a one-time cost, and a very low one at that.  It might not seems that
way when you're writing them in so many mailing list replies though ;).

In real code, having a really good str and repr, along with good semantics
makes them much more useful for debugging, and very pleasant to use.

Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130213/0a9c7a8c/attachment.pgp>


More information about the Python-ideas mailing list