
On Jul 28, 2011, at 02:49 PM, Ben Finney wrote:
What I'd hold out for, though, is::
Color.red == Fruit.tomato False
That is, all of the values from Color should compare as inequal with any other value.
Does it have to be an equality test, or is identity tests enough?
This is one of the main features to want from an enumerated type, IMO: to have a set of values that are distinct from any other value, that won't be accidentally equal to any other value, and have helpful string representations.
(Here I am consistent with the behavior of True and False.)
Do you see that (the behaviour of True and False comparing equal with integers) as anything more than backward-compatible baggage?
To me, if I had the time machine, a proper representation of a boolean type would have True and False as distinct values, never comparing equal with any other value.
Except possibly for ancient modules, does anybody still actually use the int-iness of bools explicitly? -Barry