Enum vs OrderedEnum

Rhodri James rhodri at wildebst.demon.co.uk
Tue Aug 6 19:55:49 EDT 2013


On Wed, 07 Aug 2013 00:46:39 +0100, Ian Kelly <ian.g.kelly at gmail.com>  
wrote:

> On Aug 6, 2013 5:15 PM, "Ethan Furman" <ethan at 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?

You could create sets (frozensets?) of standard and hostile environments  
as class variables.

-- 
Rhodri James *-* Wildebeest Herder to the Masses



More information about the Python-list mailing list