On Sun, Feb 24, 2013 at 1:06 AM, Antoine Pitrou <solip...@pitrou.net> wrote:
> On Sat, 23 Feb 2013 16:02:31 +0100
> Stefan Krah <ste...@bytereef.org> wrote:
>> eli.bendersky <python-check...@python.org> wrote:
>> > +Ordered comparisons between enumeration values are *not* supported.  
>> > Enums are
>> > +not integers!
>>
>> Hmm. I think this limits interoperation with C libraries and prototyping
>> C code.
>
> Agreed, this is a deal-breaker IMO. I'd actually argue that enums are
> not terribly useful apart from interacting with C constants.

I've argued in the past that we should have a "Named Value" mechanism
*before* we have a proposal to group named constants in some fashion
(such as sequential enums, or binary flag groups). It never gained
much traction, even though it could be more useful in many cases
(think things like being able to tag a file descriptor with the repr
of the object it belongs to)

After seeing this checkin, I also suggested to Eli and Barry that any
new PEP on this topic should come with a survey of *existing*
pseudo-enums in the standard library, and an explanation of how the
proposal can be used to make those either easier to debug when they
show up in error messages or otherwise make it easier to detect when
you've made a mistake while working with them.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
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