[Python-ideas] Enums
Ethan Furman
ethan at stoneleaf.us
Mon Jul 25 21:16:50 CEST 2011
Barry Warsaw wrote:
> On Jul 25, 2011, at 05:46 PM, Michael Foord wrote:
>> If the flufl enums subclassed integer then replacing most of the existing
>> constants in the standard library would be trivially easy (so we'd have a
>> built-in use case).
>
> I've so far resisted the occasional suggestion to make enum values int
> subclasses, because I think enum values should not *be* ints, but should be
> compatible with ints (as they are now). Ordered comparisons of enum values
> bothers me. ;)
If it's going to be in the stdlib, I think they should be ints -- while
not necessary most of the time, the few times it is will illicit praise
for Python and its simplicity instead of complaints about somebody
making decisions for them.
~Ethan~
More information about the Python-ideas
mailing list