[Python-ideas] Enums

Mike Meyer mwm at mired.org
Thu Jul 28 05:18:40 CEST 2011


On Thu, 28 Jul 2011 13:45:54 +1200
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> 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.

Question: how does iterating over the group fit into this? For some
enums (colors, for instance) order may be irrelevant or an
implementation detail, but you'd still like to be able to iterate over
the group.

Not sure it matters, but thought it might.

    <mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the Python-ideas mailing list