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

2013年2月23日 15:01:06 -0800

On Sat, Feb 23, 2013 at 7:02 AM, Stefan Krah <[email protected]> wrote:
> eli.bendersky <[email protected]> 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
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to