[Python-ideas] Enums
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Jul 28 03:45:54 CEST 2011
Ben Finney wrote:
> Barry Warsaw <barry at python.org> writes:
>
>>Most enums (at least IME) are discrete objects that don't have a
>>natural ordering.
>
> +1. This is an important property of an enumerated type, IMO.
If you mean that it's important for an enum *not* to have
an ordering, I disagree. There are some use cases that
benefit from having an ordering, and some that don't.
For those that don't, personally I don't care whether
it has an ordering or not.
Raising an exception on ordered comparison could perhaps
be an optional feature, but I wouldn't like it to be the
only option.
--
Greg
More information about the Python-ideas
mailing list