[Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as

Mark Janssen dreamingforward at gmail.com
Sat Feb 23 23:58:34 CET 2013


On Sat, Feb 23, 2013 at 7:02 AM, Stefan Krah <stefan at bytereef.org> wrote:
> eli.bendersky <python-checkins at python.org> wrote:
>> +Ordered comparisons between enumeration values are *not* supported.  Enums are
>> +not integers!

I agree with your idea, but note you probably shouldn't call them
e-num-erations, then.

> Hmm. I think this limits interoperation with C libraries and prototyping
> C code.

Like I say, despite the lack of alignment with C, that this is the
right way to go for a high-level language like Python.  But I don't
think it should be built-into the language.

The bigger question is: what things should be comparable?  and this is
something that has not been settled.  Nor do I believe it can be by
the language.

This is where I rather liked the old __cmp__ function, not only was it
easier to implement, but I could define a comparison and it was
clearer that I was doing so (within the class at least).

Mark


More information about the Python-Dev mailing list