Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52089

Re: Enum vs OrderedEnum

References <CALwzidm5LSH891oAvK_tzNBY5K-BNS-D970Pa_LLxZXWCb6O9w@mail.gmail.com> <520182F1.2060709@stoneleaf.us>
Date 2013-08-06 17:46 -0600
Subject Re: Enum vs OrderedEnum
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.286.1375832802.1251.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Aug 6, 2013 5:15 PM, "Ethan Furman" <ethan@stoneleaf.us> wrote:
>
> Use the .value attribute instead.  You could also substitute self for
Environment.

It feels more natural and readable to compare the enum instances rather
than their value attributes. If I am ordering the values then that seems to
imply that the enumeration itself is ordered. So I guess my question is
better stated: is there a better way to do this that doesn't involve
ordered comparisons at all?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Enum vs OrderedEnum Ian Kelly <ian.g.kelly@gmail.com> - 2013-08-06 17:46 -0600
  Re: Enum vs OrderedEnum "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-08-07 00:55 +0100

csiph-web