[Python-ideas] Enums

Barry Warsaw barry at python.org
Mon Jul 25 19:27:03 CEST 2011


On Jul 25, 2011, at 05:27 PM, MRAB wrote:

>My nitpick would be that the underlying integer values should start at
>0, not 1.

That's only relevant for the make_enum() convenience function.  For the class
syntax, you pick the values.

OT1H, make_enum() is *just* a convenience, so if you really want to start from
0, use the class syntax.  OTOH, it would probably be trivial to add an `iter`
keyword argument to make_enum() from which it could pull the integer sequence
to use.  That would be better than adding something like range()'s crazy
api. :)

-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/20110725/b2efaa00/attachment.pgp>


More information about the Python-ideas mailing list