[Python-ideas] Enums

Barry Warsaw barry at python.org
Mon Jul 25 19:15:53 CEST 2011

On Jul 24, 2011, at 09:22 PM, Raymond Hettinger wrote:

>I also don't care for enums and recommend against adding them to the
>language.  IMO, it is something that makes good sense in statically compiled
>languages and is unnecessary for us.  Not to mention, we already have several
>ways to do it (module and class namespaces for example).

IMHO, enums improve readability and debugging.  For better integration with
external systems (e.g. databases), enum values are compatible with integers.
And this

(Pdb) color
<EnumValue: Colors.blue [int=3]>

is much nicer than

(Pdb) color

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

More information about the Python-ideas mailing list