[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 24 01:37:16 CEST 2013

R. David Murray wrote:
> The first False looks correct to me, I would not expect an enum value to
> be an instance of the class that holds it as an attribute.  The second
> certainly looks odd, but what does it even mean to have an instance of
> an Enum class?

This attitude baffles me. In most other languages having a
notion of an enum, when you define an enum, you're defining
a type. The name of the enum is the name of the type, and
its values are instances of that type.

Why should our enums be any different?


More information about the Python-Dev mailing list