![](https://secure.gravatar.com/avatar/e572da4355c07804e3300bf879ffbe64.jpg?s=120&d=mm&r=g)
Ethan Furman <ethan@stoneleaf.us> writes:
In most cases I agree, but there can be exceptions. Consider:
class StoveTemps(Enum): off = 0 low = 15 medium = 50 high = 85
That doesn't seem like an appropriate use of an enumerated type, then. For an enumerated type, the integers are arbitrary and the important part is the name. If the integer values actually *mean* something, then let's have them as name bindings to those values.
In such a case I see no issues with
if temp < StoveTemps.medium: what_ever()
-- \ “Anger makes dull men witty, but it keeps them poor.” | `\ —Elizabeth Tudor | _o__) | Ben Finney