
July 27, 2011
3:10 p.m.
Ben Finney wrote:
Barry Warsaw <barry@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.
In most cases I agree, but there can be exceptions. Consider: class StoveTemps(Enum): off = 0 low = 15 medium = 50 high = 85 In such a case I see no issues with if temp < StoveTemps.medium: what_ever() ~Ethan~