
July 28, 2011
1:45 a.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.
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. Raising an exception on ordered comparison could perhaps be an optional feature, but I wouldn't like it to be the only option. -- Greg